Subversion Repositories SmartDukaan

Rev

Rev 6903 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6903 Rev 9299
Line 26... Line 26...
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);
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);
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);
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);
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);
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);
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);
-
 
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);
31
 
32
 
32
  private long id; // required
33
  private long id; // required
33
  private String name; // required
34
  private String name; // required
34
  private String address; // required
35
  private String address; // required
35
  private long declaredAmount; // required
36
  private long declaredAmount; // required
36
  private long creditedAmount; // required
37
  private long creditedAmount; // required
-
 
38
  private InsurerType insurerType; // required
37
 
39
 
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40
    ID((short)1, "id"),
42
    ID((short)1, "id"),
41
    NAME((short)2, "name"),
43
    NAME((short)2, "name"),
42
    ADDRESS((short)3, "address"),
44
    ADDRESS((short)3, "address"),
43
    DECLARED_AMOUNT((short)4, "declaredAmount"),
45
    DECLARED_AMOUNT((short)4, "declaredAmount"),
44
    CREDITED_AMOUNT((short)5, "creditedAmount");
46
    CREDITED_AMOUNT((short)5, "creditedAmount"),
-
 
47
    /**
-
 
48
     * 
-
 
49
     * @see InsurerType
-
 
50
     */
-
 
51
    INSURER_TYPE((short)6, "insurerType");
45
 
52
 
46
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
53
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
 
54
 
48
    static {
55
    static {
49
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
56
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 64... Line 71...
64
          return ADDRESS;
71
          return ADDRESS;
65
        case 4: // DECLARED_AMOUNT
72
        case 4: // DECLARED_AMOUNT
66
          return DECLARED_AMOUNT;
73
          return DECLARED_AMOUNT;
67
        case 5: // CREDITED_AMOUNT
74
        case 5: // CREDITED_AMOUNT
68
          return CREDITED_AMOUNT;
75
          return CREDITED_AMOUNT;
-
 
76
        case 6: // INSURER_TYPE
-
 
77
          return INSURER_TYPE;
69
        default:
78
        default:
70
          return null;
79
          return null;
71
      }
80
      }
72
    }
81
    }
73
 
82
 
Line 122... Line 131...
122
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
123
    tmpMap.put(_Fields.DECLARED_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("declaredAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
132
    tmpMap.put(_Fields.DECLARED_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("declaredAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
124
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
125
    tmpMap.put(_Fields.CREDITED_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("creditedAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
134
    tmpMap.put(_Fields.CREDITED_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("creditedAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
126
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
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)));
127
    metaDataMap = Collections.unmodifiableMap(tmpMap);
138
    metaDataMap = Collections.unmodifiableMap(tmpMap);
128
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Insurer.class, metaDataMap);
139
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Insurer.class, metaDataMap);
129
  }
140
  }
130
 
141
 
131
  public Insurer() {
142
  public Insurer() {
Line 134... Line 145...
134
  public Insurer(
145
  public Insurer(
135
    long id,
146
    long id,
136
    String name,
147
    String name,
137
    String address,
148
    String address,
138
    long declaredAmount,
149
    long declaredAmount,
139
    long creditedAmount)
150
    long creditedAmount,
-
 
151
    InsurerType insurerType)
140
  {
152
  {
141
    this();
153
    this();
142
    this.id = id;
154
    this.id = id;
143
    setIdIsSet(true);
155
    setIdIsSet(true);
144
    this.name = name;
156
    this.name = name;
145
    this.address = address;
157
    this.address = address;
146
    this.declaredAmount = declaredAmount;
158
    this.declaredAmount = declaredAmount;
147
    setDeclaredAmountIsSet(true);
159
    setDeclaredAmountIsSet(true);
148
    this.creditedAmount = creditedAmount;
160
    this.creditedAmount = creditedAmount;
149
    setCreditedAmountIsSet(true);
161
    setCreditedAmountIsSet(true);
-
 
162
    this.insurerType = insurerType;
150
  }
163
  }
151
 
164
 
152
  /**
165
  /**
153
   * Performs a deep copy on <i>other</i>.
166
   * Performs a deep copy on <i>other</i>.
154
   */
167
   */
Line 162... Line 175...
162
    if (other.isSetAddress()) {
175
    if (other.isSetAddress()) {
163
      this.address = other.address;
176
      this.address = other.address;
164
    }
177
    }
165
    this.declaredAmount = other.declaredAmount;
178
    this.declaredAmount = other.declaredAmount;
166
    this.creditedAmount = other.creditedAmount;
179
    this.creditedAmount = other.creditedAmount;
-
 
180
    if (other.isSetInsurerType()) {
-
 
181
      this.insurerType = other.insurerType;
-
 
182
    }
167
  }
183
  }
168
 
184
 
169
  public Insurer deepCopy() {
185
  public Insurer deepCopy() {
170
    return new Insurer(this);
186
    return new Insurer(this);
171
  }
187
  }
Line 178... Line 194...
178
    this.address = null;
194
    this.address = null;
179
    setDeclaredAmountIsSet(false);
195
    setDeclaredAmountIsSet(false);
180
    this.declaredAmount = 0;
196
    this.declaredAmount = 0;
181
    setCreditedAmountIsSet(false);
197
    setCreditedAmountIsSet(false);
182
    this.creditedAmount = 0;
198
    this.creditedAmount = 0;
-
 
199
    this.insurerType = null;
183
  }
200
  }
184
 
201
 
185
  public long getId() {
202
  public long getId() {
186
    return this.id;
203
    return this.id;
187
  }
204
  }
Line 292... Line 309...
292
 
309
 
293
  public void setCreditedAmountIsSet(boolean value) {
310
  public void setCreditedAmountIsSet(boolean value) {
294
    __isset_bit_vector.set(__CREDITEDAMOUNT_ISSET_ID, value);
311
    __isset_bit_vector.set(__CREDITEDAMOUNT_ISSET_ID, value);
295
  }
312
  }
296
 
313
 
-
 
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
 
297
  public void setFieldValue(_Fields field, Object value) {
345
  public void setFieldValue(_Fields field, Object value) {
298
    switch (field) {
346
    switch (field) {
299
    case ID:
347
    case ID:
300
      if (value == null) {
348
      if (value == null) {
301
        unsetId();
349
        unsetId();
Line 334... Line 382...
334
      } else {
382
      } else {
335
        setCreditedAmount((Long)value);
383
        setCreditedAmount((Long)value);
336
      }
384
      }
337
      break;
385
      break;
338
 
386
 
-
 
387
    case INSURER_TYPE:
-
 
388
      if (value == null) {
-
 
389
        unsetInsurerType();
-
 
390
      } else {
-
 
391
        setInsurerType((InsurerType)value);
-
 
392
      }
-
 
393
      break;
-
 
394
 
339
    }
395
    }
340
  }
396
  }
341
 
397
 
342
  public Object getFieldValue(_Fields field) {
398
  public Object getFieldValue(_Fields field) {
343
    switch (field) {
399
    switch (field) {
Line 354... Line 410...
354
      return Long.valueOf(getDeclaredAmount());
410
      return Long.valueOf(getDeclaredAmount());
355
 
411
 
356
    case CREDITED_AMOUNT:
412
    case CREDITED_AMOUNT:
357
      return Long.valueOf(getCreditedAmount());
413
      return Long.valueOf(getCreditedAmount());
358
 
414
 
-
 
415
    case INSURER_TYPE:
-
 
416
      return getInsurerType();
-
 
417
 
359
    }
418
    }
360
    throw new IllegalStateException();
419
    throw new IllegalStateException();
361
  }
420
  }
362
 
421
 
363
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
422
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 375... Line 434...
375
      return isSetAddress();
434
      return isSetAddress();
376
    case DECLARED_AMOUNT:
435
    case DECLARED_AMOUNT:
377
      return isSetDeclaredAmount();
436
      return isSetDeclaredAmount();
378
    case CREDITED_AMOUNT:
437
    case CREDITED_AMOUNT:
379
      return isSetCreditedAmount();
438
      return isSetCreditedAmount();
-
 
439
    case INSURER_TYPE:
-
 
440
      return isSetInsurerType();
380
    }
441
    }
381
    throw new IllegalStateException();
442
    throw new IllegalStateException();
382
  }
443
  }
383
 
444
 
384
  @Override
445
  @Override
Line 437... Line 498...
437
        return false;
498
        return false;
438
      if (this.creditedAmount != that.creditedAmount)
499
      if (this.creditedAmount != that.creditedAmount)
439
        return false;
500
        return false;
440
    }
501
    }
441
 
502
 
-
 
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
 
442
    return true;
512
    return true;
443
  }
513
  }
444
 
514
 
445
  @Override
515
  @Override
446
  public int hashCode() {
516
  public int hashCode() {
Line 503... Line 573...
503
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creditedAmount, typedOther.creditedAmount);
573
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creditedAmount, typedOther.creditedAmount);
504
      if (lastComparison != 0) {
574
      if (lastComparison != 0) {
505
        return lastComparison;
575
        return lastComparison;
506
      }
576
      }
507
    }
577
    }
-
 
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
    }
508
    return 0;
588
    return 0;
509
  }
589
  }
510
 
590
 
511
  public _Fields fieldForId(int fieldId) {
591
  public _Fields fieldForId(int fieldId) {
512
    return _Fields.findByThriftId(fieldId);
592
    return _Fields.findByThriftId(fieldId);
Line 558... Line 638...
558
            setCreditedAmountIsSet(true);
638
            setCreditedAmountIsSet(true);
559
          } else { 
639
          } else { 
560
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
640
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
561
          }
641
          }
562
          break;
642
          break;
-
 
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;
563
        default:
650
        default:
564
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
651
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
565
      }
652
      }
566
      iprot.readFieldEnd();
653
      iprot.readFieldEnd();
567
    }
654
    }
Line 590... Line 677...
590
    oprot.writeI64(this.declaredAmount);
677
    oprot.writeI64(this.declaredAmount);
591
    oprot.writeFieldEnd();
678
    oprot.writeFieldEnd();
592
    oprot.writeFieldBegin(CREDITED_AMOUNT_FIELD_DESC);
679
    oprot.writeFieldBegin(CREDITED_AMOUNT_FIELD_DESC);
593
    oprot.writeI64(this.creditedAmount);
680
    oprot.writeI64(this.creditedAmount);
594
    oprot.writeFieldEnd();
681
    oprot.writeFieldEnd();
-
 
682
    if (this.insurerType != null) {
-
 
683
      oprot.writeFieldBegin(INSURER_TYPE_FIELD_DESC);
-
 
684
      oprot.writeI32(this.insurerType.getValue());
-
 
685
      oprot.writeFieldEnd();
-
 
686
    }
595
    oprot.writeFieldStop();
687
    oprot.writeFieldStop();
596
    oprot.writeStructEnd();
688
    oprot.writeStructEnd();
597
  }
689
  }
598
 
690
 
599
  @Override
691
  @Override
Line 626... Line 718...
626
    first = false;
718
    first = false;
627
    if (!first) sb.append(", ");
719
    if (!first) sb.append(", ");
628
    sb.append("creditedAmount:");
720
    sb.append("creditedAmount:");
629
    sb.append(this.creditedAmount);
721
    sb.append(this.creditedAmount);
630
    first = false;
722
    first = false;
-
 
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;
631
    sb.append(")");
731
    sb.append(")");
632
    return sb.toString();
732
    return sb.toString();
633
  }
733
  }
634
 
734
 
635
  public void validate() throws org.apache.thrift.TException {
735
  public void validate() throws org.apache.thrift.TException {