Subversion Repositories SmartDukaan

Rev

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

Rev 6805 Rev 9299
Line 25... Line 25...
25
 
25
 
26
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
26
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField INSURER_FIELD_DESC = new org.apache.thrift.protocol.TField("insurer", org.apache.thrift.protocol.TType.I64, (short)2);
27
  private static final org.apache.thrift.protocol.TField INSURER_FIELD_DESC = new org.apache.thrift.protocol.TField("insurer", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField PREMIUM_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("premiumType", org.apache.thrift.protocol.TType.I32, (short)3);
28
  private static final org.apache.thrift.protocol.TField PREMIUM_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("premiumType", org.apache.thrift.protocol.TType.I32, (short)3);
29
  private static final org.apache.thrift.protocol.TField PREMIUM_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("premiumValue", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
29
  private static final org.apache.thrift.protocol.TField PREMIUM_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("premiumValue", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
-
 
30
  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)5);
30
 
31
 
31
  private long itemId; // required
32
  private long itemId; // required
32
  private long insurer; // required
33
  private long insurer; // required
33
  private PremiumType premiumType; // required
34
  private PremiumType premiumType; // required
34
  private double premiumValue; // required
35
  private double premiumValue; // required
-
 
36
  private InsurerType insurerType; // required
35
 
37
 
36
  /** 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. */
37
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
38
    ITEM_ID((short)1, "itemId"),
40
    ITEM_ID((short)1, "itemId"),
39
    INSURER((short)2, "insurer"),
41
    INSURER((short)2, "insurer"),
40
    /**
42
    /**
41
     * 
43
     * 
42
     * @see PremiumType
44
     * @see PremiumType
43
     */
45
     */
44
    PREMIUM_TYPE((short)3, "premiumType"),
46
    PREMIUM_TYPE((short)3, "premiumType"),
45
    PREMIUM_VALUE((short)4, "premiumValue");
47
    PREMIUM_VALUE((short)4, "premiumValue"),
-
 
48
    /**
-
 
49
     * 
-
 
50
     * @see InsurerType
-
 
51
     */
-
 
52
    INSURER_TYPE((short)5, "insurerType");
46
 
53
 
47
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
54
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
48
 
55
 
49
    static {
56
    static {
50
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
57
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 63... Line 70...
63
          return INSURER;
70
          return INSURER;
64
        case 3: // PREMIUM_TYPE
71
        case 3: // PREMIUM_TYPE
65
          return PREMIUM_TYPE;
72
          return PREMIUM_TYPE;
66
        case 4: // PREMIUM_VALUE
73
        case 4: // PREMIUM_VALUE
67
          return PREMIUM_VALUE;
74
          return PREMIUM_VALUE;
-
 
75
        case 5: // INSURER_TYPE
-
 
76
          return INSURER_TYPE;
68
        default:
77
        default:
69
          return null;
78
          return null;
70
      }
79
      }
71
    }
80
    }
72
 
81
 
Line 119... Line 128...
119
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
128
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
120
    tmpMap.put(_Fields.PREMIUM_TYPE, new org.apache.thrift.meta_data.FieldMetaData("premiumType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
129
    tmpMap.put(_Fields.PREMIUM_TYPE, new org.apache.thrift.meta_data.FieldMetaData("premiumType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
121
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PremiumType.class)));
130
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PremiumType.class)));
122
    tmpMap.put(_Fields.PREMIUM_VALUE, new org.apache.thrift.meta_data.FieldMetaData("premiumValue", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
    tmpMap.put(_Fields.PREMIUM_VALUE, new org.apache.thrift.meta_data.FieldMetaData("premiumValue", org.apache.thrift.TFieldRequirementType.DEFAULT, 
123
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
132
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
-
 
133
    tmpMap.put(_Fields.INSURER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("insurerType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
134
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, InsurerType.class)));
124
    metaDataMap = Collections.unmodifiableMap(tmpMap);
135
    metaDataMap = Collections.unmodifiableMap(tmpMap);
125
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ItemInsurerMapping.class, metaDataMap);
136
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ItemInsurerMapping.class, metaDataMap);
126
  }
137
  }
127
 
138
 
128
  public ItemInsurerMapping() {
139
  public ItemInsurerMapping() {
Line 130... Line 141...
130
 
141
 
131
  public ItemInsurerMapping(
142
  public ItemInsurerMapping(
132
    long itemId,
143
    long itemId,
133
    long insurer,
144
    long insurer,
134
    PremiumType premiumType,
145
    PremiumType premiumType,
135
    double premiumValue)
146
    double premiumValue,
-
 
147
    InsurerType insurerType)
136
  {
148
  {
137
    this();
149
    this();
138
    this.itemId = itemId;
150
    this.itemId = itemId;
139
    setItemIdIsSet(true);
151
    setItemIdIsSet(true);
140
    this.insurer = insurer;
152
    this.insurer = insurer;
141
    setInsurerIsSet(true);
153
    setInsurerIsSet(true);
142
    this.premiumType = premiumType;
154
    this.premiumType = premiumType;
143
    this.premiumValue = premiumValue;
155
    this.premiumValue = premiumValue;
144
    setPremiumValueIsSet(true);
156
    setPremiumValueIsSet(true);
-
 
157
    this.insurerType = insurerType;
145
  }
158
  }
146
 
159
 
147
  /**
160
  /**
148
   * Performs a deep copy on <i>other</i>.
161
   * Performs a deep copy on <i>other</i>.
149
   */
162
   */
Line 154... Line 167...
154
    this.insurer = other.insurer;
167
    this.insurer = other.insurer;
155
    if (other.isSetPremiumType()) {
168
    if (other.isSetPremiumType()) {
156
      this.premiumType = other.premiumType;
169
      this.premiumType = other.premiumType;
157
    }
170
    }
158
    this.premiumValue = other.premiumValue;
171
    this.premiumValue = other.premiumValue;
-
 
172
    if (other.isSetInsurerType()) {
-
 
173
      this.insurerType = other.insurerType;
-
 
174
    }
159
  }
175
  }
160
 
176
 
161
  public ItemInsurerMapping deepCopy() {
177
  public ItemInsurerMapping deepCopy() {
162
    return new ItemInsurerMapping(this);
178
    return new ItemInsurerMapping(this);
163
  }
179
  }
Line 169... Line 185...
169
    setInsurerIsSet(false);
185
    setInsurerIsSet(false);
170
    this.insurer = 0;
186
    this.insurer = 0;
171
    this.premiumType = null;
187
    this.premiumType = null;
172
    setPremiumValueIsSet(false);
188
    setPremiumValueIsSet(false);
173
    this.premiumValue = 0.0;
189
    this.premiumValue = 0.0;
-
 
190
    this.insurerType = null;
174
  }
191
  }
175
 
192
 
176
  public long getItemId() {
193
  public long getItemId() {
177
    return this.itemId;
194
    return this.itemId;
178
  }
195
  }
Line 268... Line 285...
268
 
285
 
269
  public void setPremiumValueIsSet(boolean value) {
286
  public void setPremiumValueIsSet(boolean value) {
270
    __isset_bit_vector.set(__PREMIUMVALUE_ISSET_ID, value);
287
    __isset_bit_vector.set(__PREMIUMVALUE_ISSET_ID, value);
271
  }
288
  }
272
 
289
 
-
 
290
  /**
-
 
291
   * 
-
 
292
   * @see InsurerType
-
 
293
   */
-
 
294
  public InsurerType getInsurerType() {
-
 
295
    return this.insurerType;
-
 
296
  }
-
 
297
 
-
 
298
  /**
-
 
299
   * 
-
 
300
   * @see InsurerType
-
 
301
   */
-
 
302
  public void setInsurerType(InsurerType insurerType) {
-
 
303
    this.insurerType = insurerType;
-
 
304
  }
-
 
305
 
-
 
306
  public void unsetInsurerType() {
-
 
307
    this.insurerType = null;
-
 
308
  }
-
 
309
 
-
 
310
  /** Returns true if field insurerType is set (has been assigned a value) and false otherwise */
-
 
311
  public boolean isSetInsurerType() {
-
 
312
    return this.insurerType != null;
-
 
313
  }
-
 
314
 
-
 
315
  public void setInsurerTypeIsSet(boolean value) {
-
 
316
    if (!value) {
-
 
317
      this.insurerType = null;
-
 
318
    }
-
 
319
  }
-
 
320
 
273
  public void setFieldValue(_Fields field, Object value) {
321
  public void setFieldValue(_Fields field, Object value) {
274
    switch (field) {
322
    switch (field) {
275
    case ITEM_ID:
323
    case ITEM_ID:
276
      if (value == null) {
324
      if (value == null) {
277
        unsetItemId();
325
        unsetItemId();
Line 302... Line 350...
302
      } else {
350
      } else {
303
        setPremiumValue((Double)value);
351
        setPremiumValue((Double)value);
304
      }
352
      }
305
      break;
353
      break;
306
 
354
 
-
 
355
    case INSURER_TYPE:
-
 
356
      if (value == null) {
-
 
357
        unsetInsurerType();
-
 
358
      } else {
-
 
359
        setInsurerType((InsurerType)value);
-
 
360
      }
-
 
361
      break;
-
 
362
 
307
    }
363
    }
308
  }
364
  }
309
 
365
 
310
  public Object getFieldValue(_Fields field) {
366
  public Object getFieldValue(_Fields field) {
311
    switch (field) {
367
    switch (field) {
Line 319... Line 375...
319
      return getPremiumType();
375
      return getPremiumType();
320
 
376
 
321
    case PREMIUM_VALUE:
377
    case PREMIUM_VALUE:
322
      return Double.valueOf(getPremiumValue());
378
      return Double.valueOf(getPremiumValue());
323
 
379
 
-
 
380
    case INSURER_TYPE:
-
 
381
      return getInsurerType();
-
 
382
 
324
    }
383
    }
325
    throw new IllegalStateException();
384
    throw new IllegalStateException();
326
  }
385
  }
327
 
386
 
328
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
387
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 338... Line 397...
338
      return isSetInsurer();
397
      return isSetInsurer();
339
    case PREMIUM_TYPE:
398
    case PREMIUM_TYPE:
340
      return isSetPremiumType();
399
      return isSetPremiumType();
341
    case PREMIUM_VALUE:
400
    case PREMIUM_VALUE:
342
      return isSetPremiumValue();
401
      return isSetPremiumValue();
-
 
402
    case INSURER_TYPE:
-
 
403
      return isSetInsurerType();
343
    }
404
    }
344
    throw new IllegalStateException();
405
    throw new IllegalStateException();
345
  }
406
  }
346
 
407
 
347
  @Override
408
  @Override
Line 391... Line 452...
391
        return false;
452
        return false;
392
      if (this.premiumValue != that.premiumValue)
453
      if (this.premiumValue != that.premiumValue)
393
        return false;
454
        return false;
394
    }
455
    }
395
 
456
 
-
 
457
    boolean this_present_insurerType = true && this.isSetInsurerType();
-
 
458
    boolean that_present_insurerType = true && that.isSetInsurerType();
-
 
459
    if (this_present_insurerType || that_present_insurerType) {
-
 
460
      if (!(this_present_insurerType && that_present_insurerType))
-
 
461
        return false;
-
 
462
      if (!this.insurerType.equals(that.insurerType))
-
 
463
        return false;
-
 
464
    }
-
 
465
 
396
    return true;
466
    return true;
397
  }
467
  }
398
 
468
 
399
  @Override
469
  @Override
400
  public int hashCode() {
470
  public int hashCode() {
Line 447... Line 517...
447
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.premiumValue, typedOther.premiumValue);
517
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.premiumValue, typedOther.premiumValue);
448
      if (lastComparison != 0) {
518
      if (lastComparison != 0) {
449
        return lastComparison;
519
        return lastComparison;
450
      }
520
      }
451
    }
521
    }
-
 
522
    lastComparison = Boolean.valueOf(isSetInsurerType()).compareTo(typedOther.isSetInsurerType());
-
 
523
    if (lastComparison != 0) {
-
 
524
      return lastComparison;
-
 
525
    }
-
 
526
    if (isSetInsurerType()) {
-
 
527
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.insurerType, typedOther.insurerType);
-
 
528
      if (lastComparison != 0) {
-
 
529
        return lastComparison;
-
 
530
      }
-
 
531
    }
452
    return 0;
532
    return 0;
453
  }
533
  }
454
 
534
 
455
  public _Fields fieldForId(int fieldId) {
535
  public _Fields fieldForId(int fieldId) {
456
    return _Fields.findByThriftId(fieldId);
536
    return _Fields.findByThriftId(fieldId);
Line 495... Line 575...
495
            setPremiumValueIsSet(true);
575
            setPremiumValueIsSet(true);
496
          } else { 
576
          } else { 
497
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
577
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
498
          }
578
          }
499
          break;
579
          break;
-
 
580
        case 5: // INSURER_TYPE
-
 
581
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
582
            this.insurerType = InsurerType.findByValue(iprot.readI32());
-
 
583
          } else { 
-
 
584
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
585
          }
-
 
586
          break;
500
        default:
587
        default:
501
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
588
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
502
      }
589
      }
503
      iprot.readFieldEnd();
590
      iprot.readFieldEnd();
504
    }
591
    }
Line 522... Line 609...
522
      oprot.writeFieldEnd();
609
      oprot.writeFieldEnd();
523
    }
610
    }
524
    oprot.writeFieldBegin(PREMIUM_VALUE_FIELD_DESC);
611
    oprot.writeFieldBegin(PREMIUM_VALUE_FIELD_DESC);
525
    oprot.writeDouble(this.premiumValue);
612
    oprot.writeDouble(this.premiumValue);
526
    oprot.writeFieldEnd();
613
    oprot.writeFieldEnd();
-
 
614
    if (this.insurerType != null) {
-
 
615
      oprot.writeFieldBegin(INSURER_TYPE_FIELD_DESC);
-
 
616
      oprot.writeI32(this.insurerType.getValue());
-
 
617
      oprot.writeFieldEnd();
-
 
618
    }
527
    oprot.writeFieldStop();
619
    oprot.writeFieldStop();
528
    oprot.writeStructEnd();
620
    oprot.writeStructEnd();
529
  }
621
  }
530
 
622
 
531
  @Override
623
  @Override
Line 550... Line 642...
550
    first = false;
642
    first = false;
551
    if (!first) sb.append(", ");
643
    if (!first) sb.append(", ");
552
    sb.append("premiumValue:");
644
    sb.append("premiumValue:");
553
    sb.append(this.premiumValue);
645
    sb.append(this.premiumValue);
554
    first = false;
646
    first = false;
-
 
647
    if (!first) sb.append(", ");
-
 
648
    sb.append("insurerType:");
-
 
649
    if (this.insurerType == null) {
-
 
650
      sb.append("null");
-
 
651
    } else {
-
 
652
      sb.append(this.insurerType);
-
 
653
    }
-
 
654
    first = false;
555
    sb.append(")");
655
    sb.append(")");
556
    return sb.toString();
656
    return sb.toString();
557
  }
657
  }
558
 
658
 
559
  public void validate() throws org.apache.thrift.TException {
659
  public void validate() throws org.apache.thrift.TException {