Subversion Repositories SmartDukaan

Rev

Rev 6903 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6805 anupam.sin 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.catalog;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class Insurer implements org.apache.thrift.TBase<Insurer, Insurer._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Insurer");
25
 
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("address", org.apache.thrift.protocol.TType.STRING, (short)3);
6903 anupam.sin 29
  private static final org.apache.thrift.protocol.TField DECLARED_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("declaredAmount", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField CREDITED_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("creditedAmount", org.apache.thrift.protocol.TType.I64, (short)5);
9299 kshitij.so 31
  private static final org.apache.thrift.protocol.TField INSURER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("insurerType", org.apache.thrift.protocol.TType.I32, (short)6);
6805 anupam.sin 32
 
33
  private long id; // required
34
  private String name; // required
35
  private String address; // required
6903 anupam.sin 36
  private long declaredAmount; // required
37
  private long creditedAmount; // required
9299 kshitij.so 38
  private InsurerType insurerType; // required
6805 anupam.sin 39
 
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
42
    ID((short)1, "id"),
43
    NAME((short)2, "name"),
6903 anupam.sin 44
    ADDRESS((short)3, "address"),
45
    DECLARED_AMOUNT((short)4, "declaredAmount"),
9299 kshitij.so 46
    CREDITED_AMOUNT((short)5, "creditedAmount"),
47
    /**
48
     * 
49
     * @see InsurerType
50
     */
51
    INSURER_TYPE((short)6, "insurerType");
6805 anupam.sin 52
 
53
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
54
 
55
    static {
56
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
57
        byName.put(field.getFieldName(), field);
58
      }
59
    }
60
 
61
    /**
62
     * Find the _Fields constant that matches fieldId, or null if its not found.
63
     */
64
    public static _Fields findByThriftId(int fieldId) {
65
      switch(fieldId) {
66
        case 1: // ID
67
          return ID;
68
        case 2: // NAME
69
          return NAME;
70
        case 3: // ADDRESS
71
          return ADDRESS;
6903 anupam.sin 72
        case 4: // DECLARED_AMOUNT
73
          return DECLARED_AMOUNT;
74
        case 5: // CREDITED_AMOUNT
75
          return CREDITED_AMOUNT;
9299 kshitij.so 76
        case 6: // INSURER_TYPE
77
          return INSURER_TYPE;
6805 anupam.sin 78
        default:
79
          return null;
80
      }
81
    }
82
 
83
    /**
84
     * Find the _Fields constant that matches fieldId, throwing an exception
85
     * if it is not found.
86
     */
87
    public static _Fields findByThriftIdOrThrow(int fieldId) {
88
      _Fields fields = findByThriftId(fieldId);
89
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
90
      return fields;
91
    }
92
 
93
    /**
94
     * Find the _Fields constant that matches name, or null if its not found.
95
     */
96
    public static _Fields findByName(String name) {
97
      return byName.get(name);
98
    }
99
 
100
    private final short _thriftId;
101
    private final String _fieldName;
102
 
103
    _Fields(short thriftId, String fieldName) {
104
      _thriftId = thriftId;
105
      _fieldName = fieldName;
106
    }
107
 
108
    public short getThriftFieldId() {
109
      return _thriftId;
110
    }
111
 
112
    public String getFieldName() {
113
      return _fieldName;
114
    }
115
  }
116
 
117
  // isset id assignments
118
  private static final int __ID_ISSET_ID = 0;
6903 anupam.sin 119
  private static final int __DECLAREDAMOUNT_ISSET_ID = 1;
120
  private static final int __CREDITEDAMOUNT_ISSET_ID = 2;
121
  private BitSet __isset_bit_vector = new BitSet(3);
6805 anupam.sin 122
 
123
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
124
  static {
125
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
126
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
127
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
128
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
129
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
130
    tmpMap.put(_Fields.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6903 anupam.sin 132
    tmpMap.put(_Fields.DECLARED_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("declaredAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
134
    tmpMap.put(_Fields.CREDITED_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("creditedAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9299 kshitij.so 136
    tmpMap.put(_Fields.INSURER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("insurerType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, InsurerType.class)));
6805 anupam.sin 138
    metaDataMap = Collections.unmodifiableMap(tmpMap);
139
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Insurer.class, metaDataMap);
140
  }
141
 
142
  public Insurer() {
143
  }
144
 
145
  public Insurer(
146
    long id,
147
    String name,
6903 anupam.sin 148
    String address,
149
    long declaredAmount,
9299 kshitij.so 150
    long creditedAmount,
151
    InsurerType insurerType)
6805 anupam.sin 152
  {
153
    this();
154
    this.id = id;
155
    setIdIsSet(true);
156
    this.name = name;
157
    this.address = address;
6903 anupam.sin 158
    this.declaredAmount = declaredAmount;
159
    setDeclaredAmountIsSet(true);
160
    this.creditedAmount = creditedAmount;
161
    setCreditedAmountIsSet(true);
9299 kshitij.so 162
    this.insurerType = insurerType;
6805 anupam.sin 163
  }
164
 
165
  /**
166
   * Performs a deep copy on <i>other</i>.
167
   */
168
  public Insurer(Insurer other) {
169
    __isset_bit_vector.clear();
170
    __isset_bit_vector.or(other.__isset_bit_vector);
171
    this.id = other.id;
172
    if (other.isSetName()) {
173
      this.name = other.name;
174
    }
175
    if (other.isSetAddress()) {
176
      this.address = other.address;
177
    }
6903 anupam.sin 178
    this.declaredAmount = other.declaredAmount;
179
    this.creditedAmount = other.creditedAmount;
9299 kshitij.so 180
    if (other.isSetInsurerType()) {
181
      this.insurerType = other.insurerType;
182
    }
6805 anupam.sin 183
  }
184
 
185
  public Insurer deepCopy() {
186
    return new Insurer(this);
187
  }
188
 
189
  @Override
190
  public void clear() {
191
    setIdIsSet(false);
192
    this.id = 0;
193
    this.name = null;
194
    this.address = null;
6903 anupam.sin 195
    setDeclaredAmountIsSet(false);
196
    this.declaredAmount = 0;
197
    setCreditedAmountIsSet(false);
198
    this.creditedAmount = 0;
9299 kshitij.so 199
    this.insurerType = null;
6805 anupam.sin 200
  }
201
 
202
  public long getId() {
203
    return this.id;
204
  }
205
 
206
  public void setId(long id) {
207
    this.id = id;
208
    setIdIsSet(true);
209
  }
210
 
211
  public void unsetId() {
212
    __isset_bit_vector.clear(__ID_ISSET_ID);
213
  }
214
 
215
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
216
  public boolean isSetId() {
217
    return __isset_bit_vector.get(__ID_ISSET_ID);
218
  }
219
 
220
  public void setIdIsSet(boolean value) {
221
    __isset_bit_vector.set(__ID_ISSET_ID, value);
222
  }
223
 
224
  public String getName() {
225
    return this.name;
226
  }
227
 
228
  public void setName(String name) {
229
    this.name = name;
230
  }
231
 
232
  public void unsetName() {
233
    this.name = null;
234
  }
235
 
236
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
237
  public boolean isSetName() {
238
    return this.name != null;
239
  }
240
 
241
  public void setNameIsSet(boolean value) {
242
    if (!value) {
243
      this.name = null;
244
    }
245
  }
246
 
247
  public String getAddress() {
248
    return this.address;
249
  }
250
 
251
  public void setAddress(String address) {
252
    this.address = address;
253
  }
254
 
255
  public void unsetAddress() {
256
    this.address = null;
257
  }
258
 
259
  /** Returns true if field address is set (has been assigned a value) and false otherwise */
260
  public boolean isSetAddress() {
261
    return this.address != null;
262
  }
263
 
264
  public void setAddressIsSet(boolean value) {
265
    if (!value) {
266
      this.address = null;
267
    }
268
  }
269
 
6903 anupam.sin 270
  public long getDeclaredAmount() {
271
    return this.declaredAmount;
272
  }
273
 
274
  public void setDeclaredAmount(long declaredAmount) {
275
    this.declaredAmount = declaredAmount;
276
    setDeclaredAmountIsSet(true);
277
  }
278
 
279
  public void unsetDeclaredAmount() {
280
    __isset_bit_vector.clear(__DECLAREDAMOUNT_ISSET_ID);
281
  }
282
 
283
  /** Returns true if field declaredAmount is set (has been assigned a value) and false otherwise */
284
  public boolean isSetDeclaredAmount() {
285
    return __isset_bit_vector.get(__DECLAREDAMOUNT_ISSET_ID);
286
  }
287
 
288
  public void setDeclaredAmountIsSet(boolean value) {
289
    __isset_bit_vector.set(__DECLAREDAMOUNT_ISSET_ID, value);
290
  }
291
 
292
  public long getCreditedAmount() {
293
    return this.creditedAmount;
294
  }
295
 
296
  public void setCreditedAmount(long creditedAmount) {
297
    this.creditedAmount = creditedAmount;
298
    setCreditedAmountIsSet(true);
299
  }
300
 
301
  public void unsetCreditedAmount() {
302
    __isset_bit_vector.clear(__CREDITEDAMOUNT_ISSET_ID);
303
  }
304
 
305
  /** Returns true if field creditedAmount is set (has been assigned a value) and false otherwise */
306
  public boolean isSetCreditedAmount() {
307
    return __isset_bit_vector.get(__CREDITEDAMOUNT_ISSET_ID);
308
  }
309
 
310
  public void setCreditedAmountIsSet(boolean value) {
311
    __isset_bit_vector.set(__CREDITEDAMOUNT_ISSET_ID, value);
312
  }
313
 
9299 kshitij.so 314
  /**
315
   * 
316
   * @see InsurerType
317
   */
318
  public InsurerType getInsurerType() {
319
    return this.insurerType;
320
  }
321
 
322
  /**
323
   * 
324
   * @see InsurerType
325
   */
326
  public void setInsurerType(InsurerType insurerType) {
327
    this.insurerType = insurerType;
328
  }
329
 
330
  public void unsetInsurerType() {
331
    this.insurerType = null;
332
  }
333
 
334
  /** Returns true if field insurerType is set (has been assigned a value) and false otherwise */
335
  public boolean isSetInsurerType() {
336
    return this.insurerType != null;
337
  }
338
 
339
  public void setInsurerTypeIsSet(boolean value) {
340
    if (!value) {
341
      this.insurerType = null;
342
    }
343
  }
344
 
6805 anupam.sin 345
  public void setFieldValue(_Fields field, Object value) {
346
    switch (field) {
347
    case ID:
348
      if (value == null) {
349
        unsetId();
350
      } else {
351
        setId((Long)value);
352
      }
353
      break;
354
 
355
    case NAME:
356
      if (value == null) {
357
        unsetName();
358
      } else {
359
        setName((String)value);
360
      }
361
      break;
362
 
363
    case ADDRESS:
364
      if (value == null) {
365
        unsetAddress();
366
      } else {
367
        setAddress((String)value);
368
      }
369
      break;
370
 
6903 anupam.sin 371
    case DECLARED_AMOUNT:
372
      if (value == null) {
373
        unsetDeclaredAmount();
374
      } else {
375
        setDeclaredAmount((Long)value);
376
      }
377
      break;
378
 
379
    case CREDITED_AMOUNT:
380
      if (value == null) {
381
        unsetCreditedAmount();
382
      } else {
383
        setCreditedAmount((Long)value);
384
      }
385
      break;
386
 
9299 kshitij.so 387
    case INSURER_TYPE:
388
      if (value == null) {
389
        unsetInsurerType();
390
      } else {
391
        setInsurerType((InsurerType)value);
392
      }
393
      break;
394
 
6805 anupam.sin 395
    }
396
  }
397
 
398
  public Object getFieldValue(_Fields field) {
399
    switch (field) {
400
    case ID:
401
      return Long.valueOf(getId());
402
 
403
    case NAME:
404
      return getName();
405
 
406
    case ADDRESS:
407
      return getAddress();
408
 
6903 anupam.sin 409
    case DECLARED_AMOUNT:
410
      return Long.valueOf(getDeclaredAmount());
411
 
412
    case CREDITED_AMOUNT:
413
      return Long.valueOf(getCreditedAmount());
414
 
9299 kshitij.so 415
    case INSURER_TYPE:
416
      return getInsurerType();
417
 
6805 anupam.sin 418
    }
419
    throw new IllegalStateException();
420
  }
421
 
422
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
423
  public boolean isSet(_Fields field) {
424
    if (field == null) {
425
      throw new IllegalArgumentException();
426
    }
427
 
428
    switch (field) {
429
    case ID:
430
      return isSetId();
431
    case NAME:
432
      return isSetName();
433
    case ADDRESS:
434
      return isSetAddress();
6903 anupam.sin 435
    case DECLARED_AMOUNT:
436
      return isSetDeclaredAmount();
437
    case CREDITED_AMOUNT:
438
      return isSetCreditedAmount();
9299 kshitij.so 439
    case INSURER_TYPE:
440
      return isSetInsurerType();
6805 anupam.sin 441
    }
442
    throw new IllegalStateException();
443
  }
444
 
445
  @Override
446
  public boolean equals(Object that) {
447
    if (that == null)
448
      return false;
449
    if (that instanceof Insurer)
450
      return this.equals((Insurer)that);
451
    return false;
452
  }
453
 
454
  public boolean equals(Insurer that) {
455
    if (that == null)
456
      return false;
457
 
458
    boolean this_present_id = true;
459
    boolean that_present_id = true;
460
    if (this_present_id || that_present_id) {
461
      if (!(this_present_id && that_present_id))
462
        return false;
463
      if (this.id != that.id)
464
        return false;
465
    }
466
 
467
    boolean this_present_name = true && this.isSetName();
468
    boolean that_present_name = true && that.isSetName();
469
    if (this_present_name || that_present_name) {
470
      if (!(this_present_name && that_present_name))
471
        return false;
472
      if (!this.name.equals(that.name))
473
        return false;
474
    }
475
 
476
    boolean this_present_address = true && this.isSetAddress();
477
    boolean that_present_address = true && that.isSetAddress();
478
    if (this_present_address || that_present_address) {
479
      if (!(this_present_address && that_present_address))
480
        return false;
481
      if (!this.address.equals(that.address))
482
        return false;
483
    }
484
 
6903 anupam.sin 485
    boolean this_present_declaredAmount = true;
486
    boolean that_present_declaredAmount = true;
487
    if (this_present_declaredAmount || that_present_declaredAmount) {
488
      if (!(this_present_declaredAmount && that_present_declaredAmount))
489
        return false;
490
      if (this.declaredAmount != that.declaredAmount)
491
        return false;
492
    }
493
 
494
    boolean this_present_creditedAmount = true;
495
    boolean that_present_creditedAmount = true;
496
    if (this_present_creditedAmount || that_present_creditedAmount) {
497
      if (!(this_present_creditedAmount && that_present_creditedAmount))
498
        return false;
499
      if (this.creditedAmount != that.creditedAmount)
500
        return false;
501
    }
502
 
9299 kshitij.so 503
    boolean this_present_insurerType = true && this.isSetInsurerType();
504
    boolean that_present_insurerType = true && that.isSetInsurerType();
505
    if (this_present_insurerType || that_present_insurerType) {
506
      if (!(this_present_insurerType && that_present_insurerType))
507
        return false;
508
      if (!this.insurerType.equals(that.insurerType))
509
        return false;
510
    }
511
 
6805 anupam.sin 512
    return true;
513
  }
514
 
515
  @Override
516
  public int hashCode() {
517
    return 0;
518
  }
519
 
520
  public int compareTo(Insurer other) {
521
    if (!getClass().equals(other.getClass())) {
522
      return getClass().getName().compareTo(other.getClass().getName());
523
    }
524
 
525
    int lastComparison = 0;
526
    Insurer typedOther = (Insurer)other;
527
 
528
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
529
    if (lastComparison != 0) {
530
      return lastComparison;
531
    }
532
    if (isSetId()) {
533
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
534
      if (lastComparison != 0) {
535
        return lastComparison;
536
      }
537
    }
538
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
539
    if (lastComparison != 0) {
540
      return lastComparison;
541
    }
542
    if (isSetName()) {
543
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
544
      if (lastComparison != 0) {
545
        return lastComparison;
546
      }
547
    }
548
    lastComparison = Boolean.valueOf(isSetAddress()).compareTo(typedOther.isSetAddress());
549
    if (lastComparison != 0) {
550
      return lastComparison;
551
    }
552
    if (isSetAddress()) {
553
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, typedOther.address);
554
      if (lastComparison != 0) {
555
        return lastComparison;
556
      }
557
    }
6903 anupam.sin 558
    lastComparison = Boolean.valueOf(isSetDeclaredAmount()).compareTo(typedOther.isSetDeclaredAmount());
559
    if (lastComparison != 0) {
560
      return lastComparison;
561
    }
562
    if (isSetDeclaredAmount()) {
563
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.declaredAmount, typedOther.declaredAmount);
564
      if (lastComparison != 0) {
565
        return lastComparison;
566
      }
567
    }
568
    lastComparison = Boolean.valueOf(isSetCreditedAmount()).compareTo(typedOther.isSetCreditedAmount());
569
    if (lastComparison != 0) {
570
      return lastComparison;
571
    }
572
    if (isSetCreditedAmount()) {
573
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creditedAmount, typedOther.creditedAmount);
574
      if (lastComparison != 0) {
575
        return lastComparison;
576
      }
577
    }
9299 kshitij.so 578
    lastComparison = Boolean.valueOf(isSetInsurerType()).compareTo(typedOther.isSetInsurerType());
579
    if (lastComparison != 0) {
580
      return lastComparison;
581
    }
582
    if (isSetInsurerType()) {
583
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.insurerType, typedOther.insurerType);
584
      if (lastComparison != 0) {
585
        return lastComparison;
586
      }
587
    }
6805 anupam.sin 588
    return 0;
589
  }
590
 
591
  public _Fields fieldForId(int fieldId) {
592
    return _Fields.findByThriftId(fieldId);
593
  }
594
 
595
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
596
    org.apache.thrift.protocol.TField field;
597
    iprot.readStructBegin();
598
    while (true)
599
    {
600
      field = iprot.readFieldBegin();
601
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
602
        break;
603
      }
604
      switch (field.id) {
605
        case 1: // ID
606
          if (field.type == org.apache.thrift.protocol.TType.I64) {
607
            this.id = iprot.readI64();
608
            setIdIsSet(true);
609
          } else { 
610
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
611
          }
612
          break;
613
        case 2: // NAME
614
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
615
            this.name = iprot.readString();
616
          } else { 
617
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
618
          }
619
          break;
620
        case 3: // ADDRESS
621
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
622
            this.address = iprot.readString();
623
          } else { 
624
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
625
          }
626
          break;
6903 anupam.sin 627
        case 4: // DECLARED_AMOUNT
628
          if (field.type == org.apache.thrift.protocol.TType.I64) {
629
            this.declaredAmount = iprot.readI64();
630
            setDeclaredAmountIsSet(true);
631
          } else { 
632
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
633
          }
634
          break;
635
        case 5: // CREDITED_AMOUNT
636
          if (field.type == org.apache.thrift.protocol.TType.I64) {
637
            this.creditedAmount = iprot.readI64();
638
            setCreditedAmountIsSet(true);
639
          } else { 
640
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
641
          }
642
          break;
9299 kshitij.so 643
        case 6: // INSURER_TYPE
644
          if (field.type == org.apache.thrift.protocol.TType.I32) {
645
            this.insurerType = InsurerType.findByValue(iprot.readI32());
646
          } else { 
647
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
648
          }
649
          break;
6805 anupam.sin 650
        default:
651
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
652
      }
653
      iprot.readFieldEnd();
654
    }
655
    iprot.readStructEnd();
656
    validate();
657
  }
658
 
659
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
660
    validate();
661
 
662
    oprot.writeStructBegin(STRUCT_DESC);
663
    oprot.writeFieldBegin(ID_FIELD_DESC);
664
    oprot.writeI64(this.id);
665
    oprot.writeFieldEnd();
666
    if (this.name != null) {
667
      oprot.writeFieldBegin(NAME_FIELD_DESC);
668
      oprot.writeString(this.name);
669
      oprot.writeFieldEnd();
670
    }
671
    if (this.address != null) {
672
      oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
673
      oprot.writeString(this.address);
674
      oprot.writeFieldEnd();
675
    }
6903 anupam.sin 676
    oprot.writeFieldBegin(DECLARED_AMOUNT_FIELD_DESC);
677
    oprot.writeI64(this.declaredAmount);
678
    oprot.writeFieldEnd();
679
    oprot.writeFieldBegin(CREDITED_AMOUNT_FIELD_DESC);
680
    oprot.writeI64(this.creditedAmount);
681
    oprot.writeFieldEnd();
9299 kshitij.so 682
    if (this.insurerType != null) {
683
      oprot.writeFieldBegin(INSURER_TYPE_FIELD_DESC);
684
      oprot.writeI32(this.insurerType.getValue());
685
      oprot.writeFieldEnd();
686
    }
6805 anupam.sin 687
    oprot.writeFieldStop();
688
    oprot.writeStructEnd();
689
  }
690
 
691
  @Override
692
  public String toString() {
693
    StringBuilder sb = new StringBuilder("Insurer(");
694
    boolean first = true;
695
 
696
    sb.append("id:");
697
    sb.append(this.id);
698
    first = false;
699
    if (!first) sb.append(", ");
700
    sb.append("name:");
701
    if (this.name == null) {
702
      sb.append("null");
703
    } else {
704
      sb.append(this.name);
705
    }
706
    first = false;
707
    if (!first) sb.append(", ");
708
    sb.append("address:");
709
    if (this.address == null) {
710
      sb.append("null");
711
    } else {
712
      sb.append(this.address);
713
    }
714
    first = false;
6903 anupam.sin 715
    if (!first) sb.append(", ");
716
    sb.append("declaredAmount:");
717
    sb.append(this.declaredAmount);
718
    first = false;
719
    if (!first) sb.append(", ");
720
    sb.append("creditedAmount:");
721
    sb.append(this.creditedAmount);
722
    first = false;
9299 kshitij.so 723
    if (!first) sb.append(", ");
724
    sb.append("insurerType:");
725
    if (this.insurerType == null) {
726
      sb.append("null");
727
    } else {
728
      sb.append(this.insurerType);
729
    }
730
    first = false;
6805 anupam.sin 731
    sb.append(")");
732
    return sb.toString();
733
  }
734
 
735
  public void validate() throws org.apache.thrift.TException {
736
    // check for required fields
737
  }
738
 
739
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
740
    try {
741
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
742
    } catch (org.apache.thrift.TException te) {
743
      throw new java.io.IOException(te);
744
    }
745
  }
746
 
747
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
748
    try {
749
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
750
      __isset_bit_vector = new BitSet(1);
751
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
752
    } catch (org.apache.thrift.TException te) {
753
      throw new java.io.IOException(te);
754
    }
755
  }
756
 
757
}
758