Subversion Repositories SmartDukaan

Rev

Rev 6805 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6805 Rev 6903
Line 24... Line 24...
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Insurer");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Insurer");
25
 
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);
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);
-
 
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);
29
 
31
 
30
  private long id; // required
32
  private long id; // required
31
  private String name; // required
33
  private String name; // required
32
  private String address; // required
34
  private String address; // required
-
 
35
  private long declaredAmount; // required
-
 
36
  private long creditedAmount; // required
33
 
37
 
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
36
    ID((short)1, "id"),
40
    ID((short)1, "id"),
37
    NAME((short)2, "name"),
41
    NAME((short)2, "name"),
38
    ADDRESS((short)3, "address");
42
    ADDRESS((short)3, "address"),
-
 
43
    DECLARED_AMOUNT((short)4, "declaredAmount"),
-
 
44
    CREDITED_AMOUNT((short)5, "creditedAmount");
39
 
45
 
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
46
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
41
 
47
 
42
    static {
48
    static {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
49
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 54... Line 60...
54
          return ID;
60
          return ID;
55
        case 2: // NAME
61
        case 2: // NAME
56
          return NAME;
62
          return NAME;
57
        case 3: // ADDRESS
63
        case 3: // ADDRESS
58
          return ADDRESS;
64
          return ADDRESS;
-
 
65
        case 4: // DECLARED_AMOUNT
-
 
66
          return DECLARED_AMOUNT;
-
 
67
        case 5: // CREDITED_AMOUNT
-
 
68
          return CREDITED_AMOUNT;
59
        default:
69
        default:
60
          return null;
70
          return null;
61
      }
71
      }
62
    }
72
    }
63
 
73
 
Line 95... Line 105...
95
    }
105
    }
96
  }
106
  }
97
 
107
 
98
  // isset id assignments
108
  // isset id assignments
99
  private static final int __ID_ISSET_ID = 0;
109
  private static final int __ID_ISSET_ID = 0;
-
 
110
  private static final int __DECLAREDAMOUNT_ISSET_ID = 1;
-
 
111
  private static final int __CREDITEDAMOUNT_ISSET_ID = 2;
100
  private BitSet __isset_bit_vector = new BitSet(1);
112
  private BitSet __isset_bit_vector = new BitSet(3);
101
 
113
 
102
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
114
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
103
  static {
115
  static {
104
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
116
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
105
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
117
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
106
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
118
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
107
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
119
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
120
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
109
    tmpMap.put(_Fields.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.DEFAULT, 
121
    tmpMap.put(_Fields.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.DEFAULT, 
110
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
122
        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, 
-
 
124
        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, 
-
 
126
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
111
    metaDataMap = Collections.unmodifiableMap(tmpMap);
127
    metaDataMap = Collections.unmodifiableMap(tmpMap);
112
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Insurer.class, metaDataMap);
128
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Insurer.class, metaDataMap);
113
  }
129
  }
114
 
130
 
115
  public Insurer() {
131
  public Insurer() {
116
  }
132
  }
117
 
133
 
118
  public Insurer(
134
  public Insurer(
119
    long id,
135
    long id,
120
    String name,
136
    String name,
121
    String address)
137
    String address,
-
 
138
    long declaredAmount,
-
 
139
    long creditedAmount)
122
  {
140
  {
123
    this();
141
    this();
124
    this.id = id;
142
    this.id = id;
125
    setIdIsSet(true);
143
    setIdIsSet(true);
126
    this.name = name;
144
    this.name = name;
127
    this.address = address;
145
    this.address = address;
-
 
146
    this.declaredAmount = declaredAmount;
-
 
147
    setDeclaredAmountIsSet(true);
-
 
148
    this.creditedAmount = creditedAmount;
-
 
149
    setCreditedAmountIsSet(true);
128
  }
150
  }
129
 
151
 
130
  /**
152
  /**
131
   * Performs a deep copy on <i>other</i>.
153
   * Performs a deep copy on <i>other</i>.
132
   */
154
   */
Line 138... Line 160...
138
      this.name = other.name;
160
      this.name = other.name;
139
    }
161
    }
140
    if (other.isSetAddress()) {
162
    if (other.isSetAddress()) {
141
      this.address = other.address;
163
      this.address = other.address;
142
    }
164
    }
-
 
165
    this.declaredAmount = other.declaredAmount;
-
 
166
    this.creditedAmount = other.creditedAmount;
143
  }
167
  }
144
 
168
 
145
  public Insurer deepCopy() {
169
  public Insurer deepCopy() {
146
    return new Insurer(this);
170
    return new Insurer(this);
147
  }
171
  }
Line 150... Line 174...
150
  public void clear() {
174
  public void clear() {
151
    setIdIsSet(false);
175
    setIdIsSet(false);
152
    this.id = 0;
176
    this.id = 0;
153
    this.name = null;
177
    this.name = null;
154
    this.address = null;
178
    this.address = null;
-
 
179
    setDeclaredAmountIsSet(false);
-
 
180
    this.declaredAmount = 0;
-
 
181
    setCreditedAmountIsSet(false);
-
 
182
    this.creditedAmount = 0;
155
  }
183
  }
156
 
184
 
157
  public long getId() {
185
  public long getId() {
158
    return this.id;
186
    return this.id;
159
  }
187
  }
Line 220... Line 248...
220
    if (!value) {
248
    if (!value) {
221
      this.address = null;
249
      this.address = null;
222
    }
250
    }
223
  }
251
  }
224
 
252
 
-
 
253
  public long getDeclaredAmount() {
-
 
254
    return this.declaredAmount;
-
 
255
  }
-
 
256
 
-
 
257
  public void setDeclaredAmount(long declaredAmount) {
-
 
258
    this.declaredAmount = declaredAmount;
-
 
259
    setDeclaredAmountIsSet(true);
-
 
260
  }
-
 
261
 
-
 
262
  public void unsetDeclaredAmount() {
-
 
263
    __isset_bit_vector.clear(__DECLAREDAMOUNT_ISSET_ID);
-
 
264
  }
-
 
265
 
-
 
266
  /** Returns true if field declaredAmount is set (has been assigned a value) and false otherwise */
-
 
267
  public boolean isSetDeclaredAmount() {
-
 
268
    return __isset_bit_vector.get(__DECLAREDAMOUNT_ISSET_ID);
-
 
269
  }
-
 
270
 
-
 
271
  public void setDeclaredAmountIsSet(boolean value) {
-
 
272
    __isset_bit_vector.set(__DECLAREDAMOUNT_ISSET_ID, value);
-
 
273
  }
-
 
274
 
-
 
275
  public long getCreditedAmount() {
-
 
276
    return this.creditedAmount;
-
 
277
  }
-
 
278
 
-
 
279
  public void setCreditedAmount(long creditedAmount) {
-
 
280
    this.creditedAmount = creditedAmount;
-
 
281
    setCreditedAmountIsSet(true);
-
 
282
  }
-
 
283
 
-
 
284
  public void unsetCreditedAmount() {
-
 
285
    __isset_bit_vector.clear(__CREDITEDAMOUNT_ISSET_ID);
-
 
286
  }
-
 
287
 
-
 
288
  /** Returns true if field creditedAmount is set (has been assigned a value) and false otherwise */
-
 
289
  public boolean isSetCreditedAmount() {
-
 
290
    return __isset_bit_vector.get(__CREDITEDAMOUNT_ISSET_ID);
-
 
291
  }
-
 
292
 
-
 
293
  public void setCreditedAmountIsSet(boolean value) {
-
 
294
    __isset_bit_vector.set(__CREDITEDAMOUNT_ISSET_ID, value);
-
 
295
  }
-
 
296
 
225
  public void setFieldValue(_Fields field, Object value) {
297
  public void setFieldValue(_Fields field, Object value) {
226
    switch (field) {
298
    switch (field) {
227
    case ID:
299
    case ID:
228
      if (value == null) {
300
      if (value == null) {
229
        unsetId();
301
        unsetId();
Line 246... Line 318...
246
      } else {
318
      } else {
247
        setAddress((String)value);
319
        setAddress((String)value);
248
      }
320
      }
249
      break;
321
      break;
250
 
322
 
-
 
323
    case DECLARED_AMOUNT:
-
 
324
      if (value == null) {
-
 
325
        unsetDeclaredAmount();
-
 
326
      } else {
-
 
327
        setDeclaredAmount((Long)value);
-
 
328
      }
-
 
329
      break;
-
 
330
 
-
 
331
    case CREDITED_AMOUNT:
-
 
332
      if (value == null) {
-
 
333
        unsetCreditedAmount();
-
 
334
      } else {
-
 
335
        setCreditedAmount((Long)value);
-
 
336
      }
-
 
337
      break;
-
 
338
 
251
    }
339
    }
252
  }
340
  }
253
 
341
 
254
  public Object getFieldValue(_Fields field) {
342
  public Object getFieldValue(_Fields field) {
255
    switch (field) {
343
    switch (field) {
Line 260... Line 348...
260
      return getName();
348
      return getName();
261
 
349
 
262
    case ADDRESS:
350
    case ADDRESS:
263
      return getAddress();
351
      return getAddress();
264
 
352
 
-
 
353
    case DECLARED_AMOUNT:
-
 
354
      return Long.valueOf(getDeclaredAmount());
-
 
355
 
-
 
356
    case CREDITED_AMOUNT:
-
 
357
      return Long.valueOf(getCreditedAmount());
-
 
358
 
265
    }
359
    }
266
    throw new IllegalStateException();
360
    throw new IllegalStateException();
267
  }
361
  }
268
 
362
 
269
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
363
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 277... Line 371...
277
      return isSetId();
371
      return isSetId();
278
    case NAME:
372
    case NAME:
279
      return isSetName();
373
      return isSetName();
280
    case ADDRESS:
374
    case ADDRESS:
281
      return isSetAddress();
375
      return isSetAddress();
-
 
376
    case DECLARED_AMOUNT:
-
 
377
      return isSetDeclaredAmount();
-
 
378
    case CREDITED_AMOUNT:
-
 
379
      return isSetCreditedAmount();
282
    }
380
    }
283
    throw new IllegalStateException();
381
    throw new IllegalStateException();
284
  }
382
  }
285
 
383
 
286
  @Override
384
  @Override
Line 321... Line 419...
321
        return false;
419
        return false;
322
      if (!this.address.equals(that.address))
420
      if (!this.address.equals(that.address))
323
        return false;
421
        return false;
324
    }
422
    }
325
 
423
 
-
 
424
    boolean this_present_declaredAmount = true;
-
 
425
    boolean that_present_declaredAmount = true;
-
 
426
    if (this_present_declaredAmount || that_present_declaredAmount) {
-
 
427
      if (!(this_present_declaredAmount && that_present_declaredAmount))
-
 
428
        return false;
-
 
429
      if (this.declaredAmount != that.declaredAmount)
-
 
430
        return false;
-
 
431
    }
-
 
432
 
-
 
433
    boolean this_present_creditedAmount = true;
-
 
434
    boolean that_present_creditedAmount = true;
-
 
435
    if (this_present_creditedAmount || that_present_creditedAmount) {
-
 
436
      if (!(this_present_creditedAmount && that_present_creditedAmount))
-
 
437
        return false;
-
 
438
      if (this.creditedAmount != that.creditedAmount)
-
 
439
        return false;
-
 
440
    }
-
 
441
 
326
    return true;
442
    return true;
327
  }
443
  }
328
 
444
 
329
  @Override
445
  @Override
330
  public int hashCode() {
446
  public int hashCode() {
Line 367... Line 483...
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, typedOther.address);
483
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, typedOther.address);
368
      if (lastComparison != 0) {
484
      if (lastComparison != 0) {
369
        return lastComparison;
485
        return lastComparison;
370
      }
486
      }
371
    }
487
    }
-
 
488
    lastComparison = Boolean.valueOf(isSetDeclaredAmount()).compareTo(typedOther.isSetDeclaredAmount());
-
 
489
    if (lastComparison != 0) {
-
 
490
      return lastComparison;
-
 
491
    }
-
 
492
    if (isSetDeclaredAmount()) {
-
 
493
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.declaredAmount, typedOther.declaredAmount);
-
 
494
      if (lastComparison != 0) {
-
 
495
        return lastComparison;
-
 
496
      }
-
 
497
    }
-
 
498
    lastComparison = Boolean.valueOf(isSetCreditedAmount()).compareTo(typedOther.isSetCreditedAmount());
-
 
499
    if (lastComparison != 0) {
-
 
500
      return lastComparison;
-
 
501
    }
-
 
502
    if (isSetCreditedAmount()) {
-
 
503
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creditedAmount, typedOther.creditedAmount);
-
 
504
      if (lastComparison != 0) {
-
 
505
        return lastComparison;
-
 
506
      }
-
 
507
    }
372
    return 0;
508
    return 0;
373
  }
509
  }
374
 
510
 
375
  public _Fields fieldForId(int fieldId) {
511
  public _Fields fieldForId(int fieldId) {
376
    return _Fields.findByThriftId(fieldId);
512
    return _Fields.findByThriftId(fieldId);
Line 406... Line 542...
406
            this.address = iprot.readString();
542
            this.address = iprot.readString();
407
          } else { 
543
          } else { 
408
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
544
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
409
          }
545
          }
410
          break;
546
          break;
-
 
547
        case 4: // DECLARED_AMOUNT
-
 
548
          if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
549
            this.declaredAmount = iprot.readI64();
-
 
550
            setDeclaredAmountIsSet(true);
-
 
551
          } else { 
-
 
552
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
553
          }
-
 
554
          break;
-
 
555
        case 5: // CREDITED_AMOUNT
-
 
556
          if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
557
            this.creditedAmount = iprot.readI64();
-
 
558
            setCreditedAmountIsSet(true);
-
 
559
          } else { 
-
 
560
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
561
          }
-
 
562
          break;
411
        default:
563
        default:
412
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
564
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
413
      }
565
      }
414
      iprot.readFieldEnd();
566
      iprot.readFieldEnd();
415
    }
567
    }
Line 432... Line 584...
432
    if (this.address != null) {
584
    if (this.address != null) {
433
      oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
585
      oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
434
      oprot.writeString(this.address);
586
      oprot.writeString(this.address);
435
      oprot.writeFieldEnd();
587
      oprot.writeFieldEnd();
436
    }
588
    }
-
 
589
    oprot.writeFieldBegin(DECLARED_AMOUNT_FIELD_DESC);
-
 
590
    oprot.writeI64(this.declaredAmount);
-
 
591
    oprot.writeFieldEnd();
-
 
592
    oprot.writeFieldBegin(CREDITED_AMOUNT_FIELD_DESC);
-
 
593
    oprot.writeI64(this.creditedAmount);
-
 
594
    oprot.writeFieldEnd();
437
    oprot.writeFieldStop();
595
    oprot.writeFieldStop();
438
    oprot.writeStructEnd();
596
    oprot.writeStructEnd();
439
  }
597
  }
440
 
598
 
441
  @Override
599
  @Override
Line 460... Line 618...
460
      sb.append("null");
618
      sb.append("null");
461
    } else {
619
    } else {
462
      sb.append(this.address);
620
      sb.append(this.address);
463
    }
621
    }
464
    first = false;
622
    first = false;
-
 
623
    if (!first) sb.append(", ");
-
 
624
    sb.append("declaredAmount:");
-
 
625
    sb.append(this.declaredAmount);
-
 
626
    first = false;
-
 
627
    if (!first) sb.append(", ");
-
 
628
    sb.append("creditedAmount:");
-
 
629
    sb.append(this.creditedAmount);
-
 
630
    first = false;
465
    sb.append(")");
631
    sb.append(")");
466
    return sb.toString();
632
    return sb.toString();
467
  }
633
  }
468
 
634
 
469
  public void validate() throws org.apache.thrift.TException {
635
  public void validate() throws org.apache.thrift.TException {