Subversion Repositories SmartDukaan

Rev

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

Rev 1013 Rev 1982
Line 31... Line 31...
31
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)3);
31
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)3);
32
  private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)4);
32
  private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)4);
33
  private static final TField UPDATED_ON_FIELD_DESC = new TField("updatedOn", TType.I64, (short)5);
33
  private static final TField UPDATED_ON_FIELD_DESC = new TField("updatedOn", TType.I64, (short)5);
34
  private static final TField LINE_STATUS_FIELD_DESC = new TField("lineStatus", TType.I32, (short)6);
34
  private static final TField LINE_STATUS_FIELD_DESC = new TField("lineStatus", TType.I32, (short)6);
35
  private static final TField ESTIMATE_FIELD_DESC = new TField("estimate", TType.I32, (short)7);
35
  private static final TField ESTIMATE_FIELD_DESC = new TField("estimate", TType.I32, (short)7);
-
 
36
  private static final TField ACTUAL_PRICE_FIELD_DESC = new TField("actualPrice", TType.DOUBLE, (short)8);
-
 
37
  private static final TField DISCOUNTED_PRICE_FIELD_DESC = new TField("discountedPrice", TType.DOUBLE, (short)9);
36
 
38
 
37
  private long cartId;
39
  private long cartId;
38
  private long itemId;
40
  private long itemId;
39
  private double quantity;
41
  private double quantity;
40
  private long createdOn;
42
  private long createdOn;
41
  private long updatedOn;
43
  private long updatedOn;
42
  private LineStatus lineStatus;
44
  private LineStatus lineStatus;
43
  private int estimate;
45
  private int estimate;
-
 
46
  private double actualPrice;
-
 
47
  private double discountedPrice;
44
 
48
 
45
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
49
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
46
  public enum _Fields implements TFieldIdEnum {
50
  public enum _Fields implements TFieldIdEnum {
47
    CART_ID((short)1, "cartId"),
51
    CART_ID((short)1, "cartId"),
48
    ITEM_ID((short)2, "itemId"),
52
    ITEM_ID((short)2, "itemId"),
Line 52... Line 56...
52
    /**
56
    /**
53
     * 
57
     * 
54
     * @see LineStatus
58
     * @see LineStatus
55
     */
59
     */
56
    LINE_STATUS((short)6, "lineStatus"),
60
    LINE_STATUS((short)6, "lineStatus"),
57
    ESTIMATE((short)7, "estimate");
61
    ESTIMATE((short)7, "estimate"),
-
 
62
    ACTUAL_PRICE((short)8, "actualPrice"),
-
 
63
    DISCOUNTED_PRICE((short)9, "discountedPrice");
58
 
64
 
59
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
65
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
60
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
66
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
61
 
67
 
62
    static {
68
    static {
Line 112... Line 118...
112
  private static final int __ITEMID_ISSET_ID = 1;
118
  private static final int __ITEMID_ISSET_ID = 1;
113
  private static final int __QUANTITY_ISSET_ID = 2;
119
  private static final int __QUANTITY_ISSET_ID = 2;
114
  private static final int __CREATEDON_ISSET_ID = 3;
120
  private static final int __CREATEDON_ISSET_ID = 3;
115
  private static final int __UPDATEDON_ISSET_ID = 4;
121
  private static final int __UPDATEDON_ISSET_ID = 4;
116
  private static final int __ESTIMATE_ISSET_ID = 5;
122
  private static final int __ESTIMATE_ISSET_ID = 5;
-
 
123
  private static final int __ACTUALPRICE_ISSET_ID = 6;
-
 
124
  private static final int __DISCOUNTEDPRICE_ISSET_ID = 7;
117
  private BitSet __isset_bit_vector = new BitSet(6);
125
  private BitSet __isset_bit_vector = new BitSet(8);
118
 
126
 
119
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
127
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
120
    put(_Fields.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
128
    put(_Fields.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
121
        new FieldValueMetaData(TType.I64)));
129
        new FieldValueMetaData(TType.I64)));
122
    put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
130
    put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
Line 129... Line 137...
129
        new FieldValueMetaData(TType.I64)));
137
        new FieldValueMetaData(TType.I64)));
130
    put(_Fields.LINE_STATUS, new FieldMetaData("lineStatus", TFieldRequirementType.DEFAULT, 
138
    put(_Fields.LINE_STATUS, new FieldMetaData("lineStatus", TFieldRequirementType.DEFAULT, 
131
        new EnumMetaData(TType.ENUM, LineStatus.class)));
139
        new EnumMetaData(TType.ENUM, LineStatus.class)));
132
    put(_Fields.ESTIMATE, new FieldMetaData("estimate", TFieldRequirementType.DEFAULT, 
140
    put(_Fields.ESTIMATE, new FieldMetaData("estimate", TFieldRequirementType.DEFAULT, 
133
        new FieldValueMetaData(TType.I32)));
141
        new FieldValueMetaData(TType.I32)));
-
 
142
    put(_Fields.ACTUAL_PRICE, new FieldMetaData("actualPrice", TFieldRequirementType.DEFAULT, 
-
 
143
        new FieldValueMetaData(TType.DOUBLE)));
-
 
144
    put(_Fields.DISCOUNTED_PRICE, new FieldMetaData("discountedPrice", TFieldRequirementType.DEFAULT, 
-
 
145
        new FieldValueMetaData(TType.DOUBLE)));
134
  }});
146
  }});
135
 
147
 
136
  static {
148
  static {
137
    FieldMetaData.addStructMetaDataMap(Line.class, metaDataMap);
149
    FieldMetaData.addStructMetaDataMap(Line.class, metaDataMap);
138
  }
150
  }
Line 145... Line 157...
145
    long itemId,
157
    long itemId,
146
    double quantity,
158
    double quantity,
147
    long createdOn,
159
    long createdOn,
148
    long updatedOn,
160
    long updatedOn,
149
    LineStatus lineStatus,
161
    LineStatus lineStatus,
150
    int estimate)
162
    int estimate,
-
 
163
    double actualPrice,
-
 
164
    double discountedPrice)
151
  {
165
  {
152
    this();
166
    this();
153
    this.cartId = cartId;
167
    this.cartId = cartId;
154
    setCartIdIsSet(true);
168
    setCartIdIsSet(true);
155
    this.itemId = itemId;
169
    this.itemId = itemId;
Line 161... Line 175...
161
    this.updatedOn = updatedOn;
175
    this.updatedOn = updatedOn;
162
    setUpdatedOnIsSet(true);
176
    setUpdatedOnIsSet(true);
163
    this.lineStatus = lineStatus;
177
    this.lineStatus = lineStatus;
164
    this.estimate = estimate;
178
    this.estimate = estimate;
165
    setEstimateIsSet(true);
179
    setEstimateIsSet(true);
-
 
180
    this.actualPrice = actualPrice;
-
 
181
    setActualPriceIsSet(true);
-
 
182
    this.discountedPrice = discountedPrice;
-
 
183
    setDiscountedPriceIsSet(true);
166
  }
184
  }
167
 
185
 
168
  /**
186
  /**
169
   * Performs a deep copy on <i>other</i>.
187
   * Performs a deep copy on <i>other</i>.
170
   */
188
   */
Line 178... Line 196...
178
    this.updatedOn = other.updatedOn;
196
    this.updatedOn = other.updatedOn;
179
    if (other.isSetLineStatus()) {
197
    if (other.isSetLineStatus()) {
180
      this.lineStatus = other.lineStatus;
198
      this.lineStatus = other.lineStatus;
181
    }
199
    }
182
    this.estimate = other.estimate;
200
    this.estimate = other.estimate;
-
 
201
    this.actualPrice = other.actualPrice;
-
 
202
    this.discountedPrice = other.discountedPrice;
183
  }
203
  }
184
 
204
 
185
  public Line deepCopy() {
205
  public Line deepCopy() {
186
    return new Line(this);
206
    return new Line(this);
187
  }
207
  }
Line 359... Line 379...
359
 
379
 
360
  public void setEstimateIsSet(boolean value) {
380
  public void setEstimateIsSet(boolean value) {
361
    __isset_bit_vector.set(__ESTIMATE_ISSET_ID, value);
381
    __isset_bit_vector.set(__ESTIMATE_ISSET_ID, value);
362
  }
382
  }
363
 
383
 
-
 
384
  public double getActualPrice() {
-
 
385
    return this.actualPrice;
-
 
386
  }
-
 
387
 
-
 
388
  public Line setActualPrice(double actualPrice) {
-
 
389
    this.actualPrice = actualPrice;
-
 
390
    setActualPriceIsSet(true);
-
 
391
    return this;
-
 
392
  }
-
 
393
 
-
 
394
  public void unsetActualPrice() {
-
 
395
    __isset_bit_vector.clear(__ACTUALPRICE_ISSET_ID);
-
 
396
  }
-
 
397
 
-
 
398
  /** Returns true if field actualPrice is set (has been asigned a value) and false otherwise */
-
 
399
  public boolean isSetActualPrice() {
-
 
400
    return __isset_bit_vector.get(__ACTUALPRICE_ISSET_ID);
-
 
401
  }
-
 
402
 
-
 
403
  public void setActualPriceIsSet(boolean value) {
-
 
404
    __isset_bit_vector.set(__ACTUALPRICE_ISSET_ID, value);
-
 
405
  }
-
 
406
 
-
 
407
  public double getDiscountedPrice() {
-
 
408
    return this.discountedPrice;
-
 
409
  }
-
 
410
 
-
 
411
  public Line setDiscountedPrice(double discountedPrice) {
-
 
412
    this.discountedPrice = discountedPrice;
-
 
413
    setDiscountedPriceIsSet(true);
-
 
414
    return this;
-
 
415
  }
-
 
416
 
-
 
417
  public void unsetDiscountedPrice() {
-
 
418
    __isset_bit_vector.clear(__DISCOUNTEDPRICE_ISSET_ID);
-
 
419
  }
-
 
420
 
-
 
421
  /** Returns true if field discountedPrice is set (has been asigned a value) and false otherwise */
-
 
422
  public boolean isSetDiscountedPrice() {
-
 
423
    return __isset_bit_vector.get(__DISCOUNTEDPRICE_ISSET_ID);
-
 
424
  }
-
 
425
 
-
 
426
  public void setDiscountedPriceIsSet(boolean value) {
-
 
427
    __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
-
 
428
  }
-
 
429
 
364
  public void setFieldValue(_Fields field, Object value) {
430
  public void setFieldValue(_Fields field, Object value) {
365
    switch (field) {
431
    switch (field) {
366
    case CART_ID:
432
    case CART_ID:
367
      if (value == null) {
433
      if (value == null) {
368
        unsetCartId();
434
        unsetCartId();
Line 417... Line 483...
417
      } else {
483
      } else {
418
        setEstimate((Integer)value);
484
        setEstimate((Integer)value);
419
      }
485
      }
420
      break;
486
      break;
421
 
487
 
-
 
488
    case ACTUAL_PRICE:
-
 
489
      if (value == null) {
-
 
490
        unsetActualPrice();
-
 
491
      } else {
-
 
492
        setActualPrice((Double)value);
-
 
493
      }
-
 
494
      break;
-
 
495
 
-
 
496
    case DISCOUNTED_PRICE:
-
 
497
      if (value == null) {
-
 
498
        unsetDiscountedPrice();
-
 
499
      } else {
-
 
500
        setDiscountedPrice((Double)value);
-
 
501
      }
-
 
502
      break;
-
 
503
 
422
    }
504
    }
423
  }
505
  }
424
 
506
 
425
  public void setFieldValue(int fieldID, Object value) {
507
  public void setFieldValue(int fieldID, Object value) {
426
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
508
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 447... Line 529...
447
      return getLineStatus();
529
      return getLineStatus();
448
 
530
 
449
    case ESTIMATE:
531
    case ESTIMATE:
450
      return new Integer(getEstimate());
532
      return new Integer(getEstimate());
451
 
533
 
-
 
534
    case ACTUAL_PRICE:
-
 
535
      return new Double(getActualPrice());
-
 
536
 
-
 
537
    case DISCOUNTED_PRICE:
-
 
538
      return new Double(getDiscountedPrice());
-
 
539
 
452
    }
540
    }
453
    throw new IllegalStateException();
541
    throw new IllegalStateException();
454
  }
542
  }
455
 
543
 
456
  public Object getFieldValue(int fieldId) {
544
  public Object getFieldValue(int fieldId) {
Line 472... Line 560...
472
      return isSetUpdatedOn();
560
      return isSetUpdatedOn();
473
    case LINE_STATUS:
561
    case LINE_STATUS:
474
      return isSetLineStatus();
562
      return isSetLineStatus();
475
    case ESTIMATE:
563
    case ESTIMATE:
476
      return isSetEstimate();
564
      return isSetEstimate();
-
 
565
    case ACTUAL_PRICE:
-
 
566
      return isSetActualPrice();
-
 
567
    case DISCOUNTED_PRICE:
-
 
568
      return isSetDiscountedPrice();
477
    }
569
    }
478
    throw new IllegalStateException();
570
    throw new IllegalStateException();
479
  }
571
  }
480
 
572
 
481
  public boolean isSet(int fieldID) {
573
  public boolean isSet(int fieldID) {
Line 556... Line 648...
556
        return false;
648
        return false;
557
      if (this.estimate != that.estimate)
649
      if (this.estimate != that.estimate)
558
        return false;
650
        return false;
559
    }
651
    }
560
 
652
 
-
 
653
    boolean this_present_actualPrice = true;
-
 
654
    boolean that_present_actualPrice = true;
-
 
655
    if (this_present_actualPrice || that_present_actualPrice) {
-
 
656
      if (!(this_present_actualPrice && that_present_actualPrice))
-
 
657
        return false;
-
 
658
      if (this.actualPrice != that.actualPrice)
-
 
659
        return false;
-
 
660
    }
-
 
661
 
-
 
662
    boolean this_present_discountedPrice = true;
-
 
663
    boolean that_present_discountedPrice = true;
-
 
664
    if (this_present_discountedPrice || that_present_discountedPrice) {
-
 
665
      if (!(this_present_discountedPrice && that_present_discountedPrice))
-
 
666
        return false;
-
 
667
      if (this.discountedPrice != that.discountedPrice)
-
 
668
        return false;
-
 
669
    }
-
 
670
 
561
    return true;
671
    return true;
562
  }
672
  }
563
 
673
 
564
  @Override
674
  @Override
565
  public int hashCode() {
675
  public int hashCode() {
Line 628... Line 738...
628
    }
738
    }
629
    lastComparison = TBaseHelper.compareTo(estimate, typedOther.estimate);
739
    lastComparison = TBaseHelper.compareTo(estimate, typedOther.estimate);
630
    if (lastComparison != 0) {
740
    if (lastComparison != 0) {
631
      return lastComparison;
741
      return lastComparison;
632
    }
742
    }
-
 
743
    lastComparison = Boolean.valueOf(isSetActualPrice()).compareTo(isSetActualPrice());
-
 
744
    if (lastComparison != 0) {
-
 
745
      return lastComparison;
-
 
746
    }
-
 
747
    lastComparison = TBaseHelper.compareTo(actualPrice, typedOther.actualPrice);
-
 
748
    if (lastComparison != 0) {
-
 
749
      return lastComparison;
-
 
750
    }
-
 
751
    lastComparison = Boolean.valueOf(isSetDiscountedPrice()).compareTo(isSetDiscountedPrice());
-
 
752
    if (lastComparison != 0) {
-
 
753
      return lastComparison;
-
 
754
    }
-
 
755
    lastComparison = TBaseHelper.compareTo(discountedPrice, typedOther.discountedPrice);
-
 
756
    if (lastComparison != 0) {
-
 
757
      return lastComparison;
-
 
758
    }
633
    return 0;
759
    return 0;
634
  }
760
  }
635
 
761
 
636
  public void read(TProtocol iprot) throws TException {
762
  public void read(TProtocol iprot) throws TException {
637
    TField field;
763
    TField field;
Line 700... Line 826...
700
              setEstimateIsSet(true);
826
              setEstimateIsSet(true);
701
            } else { 
827
            } else { 
702
              TProtocolUtil.skip(iprot, field.type);
828
              TProtocolUtil.skip(iprot, field.type);
703
            }
829
            }
704
            break;
830
            break;
-
 
831
          case ACTUAL_PRICE:
-
 
832
            if (field.type == TType.DOUBLE) {
-
 
833
              this.actualPrice = iprot.readDouble();
-
 
834
              setActualPriceIsSet(true);
-
 
835
            } else { 
-
 
836
              TProtocolUtil.skip(iprot, field.type);
-
 
837
            }
-
 
838
            break;
-
 
839
          case DISCOUNTED_PRICE:
-
 
840
            if (field.type == TType.DOUBLE) {
-
 
841
              this.discountedPrice = iprot.readDouble();
-
 
842
              setDiscountedPriceIsSet(true);
-
 
843
            } else { 
-
 
844
              TProtocolUtil.skip(iprot, field.type);
-
 
845
            }
-
 
846
            break;
705
        }
847
        }
706
        iprot.readFieldEnd();
848
        iprot.readFieldEnd();
707
      }
849
      }
708
    }
850
    }
709
    iprot.readStructEnd();
851
    iprot.readStructEnd();
Line 735... Line 877...
735
      oprot.writeFieldEnd();
877
      oprot.writeFieldEnd();
736
    }
878
    }
737
    oprot.writeFieldBegin(ESTIMATE_FIELD_DESC);
879
    oprot.writeFieldBegin(ESTIMATE_FIELD_DESC);
738
    oprot.writeI32(this.estimate);
880
    oprot.writeI32(this.estimate);
739
    oprot.writeFieldEnd();
881
    oprot.writeFieldEnd();
-
 
882
    oprot.writeFieldBegin(ACTUAL_PRICE_FIELD_DESC);
-
 
883
    oprot.writeDouble(this.actualPrice);
-
 
884
    oprot.writeFieldEnd();
-
 
885
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
-
 
886
    oprot.writeDouble(this.discountedPrice);
-
 
887
    oprot.writeFieldEnd();
740
    oprot.writeFieldStop();
888
    oprot.writeFieldStop();
741
    oprot.writeStructEnd();
889
    oprot.writeStructEnd();
742
  }
890
  }
743
 
891
 
744
  @Override
892
  @Override
Line 783... Line 931...
783
    first = false;
931
    first = false;
784
    if (!first) sb.append(", ");
932
    if (!first) sb.append(", ");
785
    sb.append("estimate:");
933
    sb.append("estimate:");
786
    sb.append(this.estimate);
934
    sb.append(this.estimate);
787
    first = false;
935
    first = false;
-
 
936
    if (!first) sb.append(", ");
-
 
937
    sb.append("actualPrice:");
-
 
938
    sb.append(this.actualPrice);
-
 
939
    first = false;
-
 
940
    if (!first) sb.append(", ");
-
 
941
    sb.append("discountedPrice:");
-
 
942
    sb.append(this.discountedPrice);
-
 
943
    first = false;
788
    sb.append(")");
944
    sb.append(")");
789
    return sb.toString();
945
    return sb.toString();
790
  }
946
  }
791
 
947
 
792
  public void validate() throws TException {
948
  public void validate() throws TException {