Subversion Repositories SmartDukaan

Rev

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

Rev 3430 Rev 3555
Line 30... Line 30...
30
  private static final org.apache.thrift.protocol.TField UPDATED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedOn", org.apache.thrift.protocol.TType.I64, (short)5);
30
  private static final org.apache.thrift.protocol.TField UPDATED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedOn", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField LINE_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("lineStatus", org.apache.thrift.protocol.TType.I32, (short)6);
31
  private static final org.apache.thrift.protocol.TField LINE_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("lineStatus", org.apache.thrift.protocol.TType.I32, (short)6);
32
  private static final org.apache.thrift.protocol.TField ESTIMATE_FIELD_DESC = new org.apache.thrift.protocol.TField("estimate", org.apache.thrift.protocol.TType.I32, (short)7);
32
  private static final org.apache.thrift.protocol.TField ESTIMATE_FIELD_DESC = new org.apache.thrift.protocol.TField("estimate", org.apache.thrift.protocol.TType.I32, (short)7);
33
  private static final org.apache.thrift.protocol.TField ACTUAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("actualPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
33
  private static final org.apache.thrift.protocol.TField ACTUAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("actualPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
34
  private static final org.apache.thrift.protocol.TField DISCOUNTED_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("discountedPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
34
  private static final org.apache.thrift.protocol.TField DISCOUNTED_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("discountedPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
-
 
35
  private static final org.apache.thrift.protocol.TField DISCOUNTS_FIELD_DESC = new org.apache.thrift.protocol.TField("discounts", org.apache.thrift.protocol.TType.LIST, (short)10);
35
 
36
 
36
  private long cartId; // required
37
  private long cartId; // required
37
  private long itemId; // required
38
  private long itemId; // required
38
  private double quantity; // required
39
  private double quantity; // required
39
  private long createdOn; // required
40
  private long createdOn; // required
40
  private long updatedOn; // required
41
  private long updatedOn; // required
41
  private LineStatus lineStatus; // required
42
  private LineStatus lineStatus; // required
42
  private int estimate; // required
43
  private int estimate; // required
43
  private double actualPrice; // required
44
  private double actualPrice; // required
44
  private double discountedPrice; // required
45
  private double discountedPrice; // required
-
 
46
  private List<Discount> discounts; // required
45
 
47
 
46
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
48
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
47
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
49
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
48
    CART_ID((short)1, "cartId"),
50
    CART_ID((short)1, "cartId"),
49
    ITEM_ID((short)2, "itemId"),
51
    ITEM_ID((short)2, "itemId"),
Line 55... Line 57...
55
     * @see LineStatus
57
     * @see LineStatus
56
     */
58
     */
57
    LINE_STATUS((short)6, "lineStatus"),
59
    LINE_STATUS((short)6, "lineStatus"),
58
    ESTIMATE((short)7, "estimate"),
60
    ESTIMATE((short)7, "estimate"),
59
    ACTUAL_PRICE((short)8, "actualPrice"),
61
    ACTUAL_PRICE((short)8, "actualPrice"),
60
    DISCOUNTED_PRICE((short)9, "discountedPrice");
62
    DISCOUNTED_PRICE((short)9, "discountedPrice"),
-
 
63
    DISCOUNTS((short)10, "discounts");
61
 
64
 
62
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
65
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
63
 
66
 
64
    static {
67
    static {
65
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
68
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 88... Line 91...
88
          return ESTIMATE;
91
          return ESTIMATE;
89
        case 8: // ACTUAL_PRICE
92
        case 8: // ACTUAL_PRICE
90
          return ACTUAL_PRICE;
93
          return ACTUAL_PRICE;
91
        case 9: // DISCOUNTED_PRICE
94
        case 9: // DISCOUNTED_PRICE
92
          return DISCOUNTED_PRICE;
95
          return DISCOUNTED_PRICE;
-
 
96
        case 10: // DISCOUNTS
-
 
97
          return DISCOUNTS;
93
        default:
98
        default:
94
          return null;
99
          return null;
95
      }
100
      }
96
    }
101
    }
97
 
102
 
Line 159... Line 164...
159
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
164
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
160
    tmpMap.put(_Fields.ACTUAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("actualPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
165
    tmpMap.put(_Fields.ACTUAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("actualPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
161
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
166
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
162
    tmpMap.put(_Fields.DISCOUNTED_PRICE, new org.apache.thrift.meta_data.FieldMetaData("discountedPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
167
    tmpMap.put(_Fields.DISCOUNTED_PRICE, new org.apache.thrift.meta_data.FieldMetaData("discountedPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
163
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
168
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
-
 
169
    tmpMap.put(_Fields.DISCOUNTS, new org.apache.thrift.meta_data.FieldMetaData("discounts", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
170
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
-
 
171
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Discount.class))));
164
    metaDataMap = Collections.unmodifiableMap(tmpMap);
172
    metaDataMap = Collections.unmodifiableMap(tmpMap);
165
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Line.class, metaDataMap);
173
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Line.class, metaDataMap);
166
  }
174
  }
167
 
175
 
168
  public Line() {
176
  public Line() {
Line 175... Line 183...
175
    long createdOn,
183
    long createdOn,
176
    long updatedOn,
184
    long updatedOn,
177
    LineStatus lineStatus,
185
    LineStatus lineStatus,
178
    int estimate,
186
    int estimate,
179
    double actualPrice,
187
    double actualPrice,
180
    double discountedPrice)
188
    double discountedPrice,
-
 
189
    List<Discount> discounts)
181
  {
190
  {
182
    this();
191
    this();
183
    this.cartId = cartId;
192
    this.cartId = cartId;
184
    setCartIdIsSet(true);
193
    setCartIdIsSet(true);
185
    this.itemId = itemId;
194
    this.itemId = itemId;
Line 195... Line 204...
195
    setEstimateIsSet(true);
204
    setEstimateIsSet(true);
196
    this.actualPrice = actualPrice;
205
    this.actualPrice = actualPrice;
197
    setActualPriceIsSet(true);
206
    setActualPriceIsSet(true);
198
    this.discountedPrice = discountedPrice;
207
    this.discountedPrice = discountedPrice;
199
    setDiscountedPriceIsSet(true);
208
    setDiscountedPriceIsSet(true);
-
 
209
    this.discounts = discounts;
200
  }
210
  }
201
 
211
 
202
  /**
212
  /**
203
   * Performs a deep copy on <i>other</i>.
213
   * Performs a deep copy on <i>other</i>.
204
   */
214
   */
Line 214... Line 224...
214
      this.lineStatus = other.lineStatus;
224
      this.lineStatus = other.lineStatus;
215
    }
225
    }
216
    this.estimate = other.estimate;
226
    this.estimate = other.estimate;
217
    this.actualPrice = other.actualPrice;
227
    this.actualPrice = other.actualPrice;
218
    this.discountedPrice = other.discountedPrice;
228
    this.discountedPrice = other.discountedPrice;
-
 
229
    if (other.isSetDiscounts()) {
-
 
230
      List<Discount> __this__discounts = new ArrayList<Discount>();
-
 
231
      for (Discount other_element : other.discounts) {
-
 
232
        __this__discounts.add(new Discount(other_element));
-
 
233
      }
-
 
234
      this.discounts = __this__discounts;
-
 
235
    }
219
  }
236
  }
220
 
237
 
221
  public Line deepCopy() {
238
  public Line deepCopy() {
222
    return new Line(this);
239
    return new Line(this);
223
  }
240
  }
Line 239... Line 256...
239
    this.estimate = 0;
256
    this.estimate = 0;
240
    setActualPriceIsSet(false);
257
    setActualPriceIsSet(false);
241
    this.actualPrice = 0.0;
258
    this.actualPrice = 0.0;
242
    setDiscountedPriceIsSet(false);
259
    setDiscountedPriceIsSet(false);
243
    this.discountedPrice = 0.0;
260
    this.discountedPrice = 0.0;
-
 
261
    this.discounts = null;
244
  }
262
  }
245
 
263
 
246
  public long getCartId() {
264
  public long getCartId() {
247
    return this.cartId;
265
    return this.cartId;
248
  }
266
  }
Line 448... Line 466...
448
 
466
 
449
  public void setDiscountedPriceIsSet(boolean value) {
467
  public void setDiscountedPriceIsSet(boolean value) {
450
    __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
468
    __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
451
  }
469
  }
452
 
470
 
-
 
471
  public int getDiscountsSize() {
-
 
472
    return (this.discounts == null) ? 0 : this.discounts.size();
-
 
473
  }
-
 
474
 
-
 
475
  public java.util.Iterator<Discount> getDiscountsIterator() {
-
 
476
    return (this.discounts == null) ? null : this.discounts.iterator();
-
 
477
  }
-
 
478
 
-
 
479
  public void addToDiscounts(Discount elem) {
-
 
480
    if (this.discounts == null) {
-
 
481
      this.discounts = new ArrayList<Discount>();
-
 
482
    }
-
 
483
    this.discounts.add(elem);
-
 
484
  }
-
 
485
 
-
 
486
  public List<Discount> getDiscounts() {
-
 
487
    return this.discounts;
-
 
488
  }
-
 
489
 
-
 
490
  public void setDiscounts(List<Discount> discounts) {
-
 
491
    this.discounts = discounts;
-
 
492
  }
-
 
493
 
-
 
494
  public void unsetDiscounts() {
-
 
495
    this.discounts = null;
-
 
496
  }
-
 
497
 
-
 
498
  /** Returns true if field discounts is set (has been assigned a value) and false otherwise */
-
 
499
  public boolean isSetDiscounts() {
-
 
500
    return this.discounts != null;
-
 
501
  }
-
 
502
 
-
 
503
  public void setDiscountsIsSet(boolean value) {
-
 
504
    if (!value) {
-
 
505
      this.discounts = null;
-
 
506
    }
-
 
507
  }
-
 
508
 
453
  public void setFieldValue(_Fields field, Object value) {
509
  public void setFieldValue(_Fields field, Object value) {
454
    switch (field) {
510
    switch (field) {
455
    case CART_ID:
511
    case CART_ID:
456
      if (value == null) {
512
      if (value == null) {
457
        unsetCartId();
513
        unsetCartId();
Line 522... Line 578...
522
      } else {
578
      } else {
523
        setDiscountedPrice((Double)value);
579
        setDiscountedPrice((Double)value);
524
      }
580
      }
525
      break;
581
      break;
526
 
582
 
-
 
583
    case DISCOUNTS:
-
 
584
      if (value == null) {
-
 
585
        unsetDiscounts();
-
 
586
      } else {
-
 
587
        setDiscounts((List<Discount>)value);
-
 
588
      }
-
 
589
      break;
-
 
590
 
527
    }
591
    }
528
  }
592
  }
529
 
593
 
530
  public Object getFieldValue(_Fields field) {
594
  public Object getFieldValue(_Fields field) {
531
    switch (field) {
595
    switch (field) {
Line 554... Line 618...
554
      return Double.valueOf(getActualPrice());
618
      return Double.valueOf(getActualPrice());
555
 
619
 
556
    case DISCOUNTED_PRICE:
620
    case DISCOUNTED_PRICE:
557
      return Double.valueOf(getDiscountedPrice());
621
      return Double.valueOf(getDiscountedPrice());
558
 
622
 
-
 
623
    case DISCOUNTS:
-
 
624
      return getDiscounts();
-
 
625
 
559
    }
626
    }
560
    throw new IllegalStateException();
627
    throw new IllegalStateException();
561
  }
628
  }
562
 
629
 
563
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
630
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 583... Line 650...
583
      return isSetEstimate();
650
      return isSetEstimate();
584
    case ACTUAL_PRICE:
651
    case ACTUAL_PRICE:
585
      return isSetActualPrice();
652
      return isSetActualPrice();
586
    case DISCOUNTED_PRICE:
653
    case DISCOUNTED_PRICE:
587
      return isSetDiscountedPrice();
654
      return isSetDiscountedPrice();
-
 
655
    case DISCOUNTS:
-
 
656
      return isSetDiscounts();
588
    }
657
    }
589
    throw new IllegalStateException();
658
    throw new IllegalStateException();
590
  }
659
  }
591
 
660
 
592
  @Override
661
  @Override
Line 681... Line 750...
681
        return false;
750
        return false;
682
      if (this.discountedPrice != that.discountedPrice)
751
      if (this.discountedPrice != that.discountedPrice)
683
        return false;
752
        return false;
684
    }
753
    }
685
 
754
 
-
 
755
    boolean this_present_discounts = true && this.isSetDiscounts();
-
 
756
    boolean that_present_discounts = true && that.isSetDiscounts();
-
 
757
    if (this_present_discounts || that_present_discounts) {
-
 
758
      if (!(this_present_discounts && that_present_discounts))
-
 
759
        return false;
-
 
760
      if (!this.discounts.equals(that.discounts))
-
 
761
        return false;
-
 
762
    }
-
 
763
 
686
    return true;
764
    return true;
687
  }
765
  }
688
 
766
 
689
  @Override
767
  @Override
690
  public int hashCode() {
768
  public int hashCode() {
Line 787... Line 865...
787
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discountedPrice, typedOther.discountedPrice);
865
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discountedPrice, typedOther.discountedPrice);
788
      if (lastComparison != 0) {
866
      if (lastComparison != 0) {
789
        return lastComparison;
867
        return lastComparison;
790
      }
868
      }
791
    }
869
    }
-
 
870
    lastComparison = Boolean.valueOf(isSetDiscounts()).compareTo(typedOther.isSetDiscounts());
-
 
871
    if (lastComparison != 0) {
-
 
872
      return lastComparison;
-
 
873
    }
-
 
874
    if (isSetDiscounts()) {
-
 
875
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discounts, typedOther.discounts);
-
 
876
      if (lastComparison != 0) {
-
 
877
        return lastComparison;
-
 
878
      }
-
 
879
    }
792
    return 0;
880
    return 0;
793
  }
881
  }
794
 
882
 
795
  public _Fields fieldForId(int fieldId) {
883
  public _Fields fieldForId(int fieldId) {
796
    return _Fields.findByThriftId(fieldId);
884
    return _Fields.findByThriftId(fieldId);
Line 875... Line 963...
875
            setDiscountedPriceIsSet(true);
963
            setDiscountedPriceIsSet(true);
876
          } else { 
964
          } else { 
877
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
965
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
878
          }
966
          }
879
          break;
967
          break;
-
 
968
        case 10: // DISCOUNTS
-
 
969
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
-
 
970
            {
-
 
971
              org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
-
 
972
              this.discounts = new ArrayList<Discount>(_list8.size);
-
 
973
              for (int _i9 = 0; _i9 < _list8.size; ++_i9)
-
 
974
              {
-
 
975
                Discount _elem10; // required
-
 
976
                _elem10 = new Discount();
-
 
977
                _elem10.read(iprot);
-
 
978
                this.discounts.add(_elem10);
-
 
979
              }
-
 
980
              iprot.readListEnd();
-
 
981
            }
-
 
982
          } else { 
-
 
983
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
984
          }
-
 
985
          break;
880
        default:
986
        default:
881
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
987
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
882
      }
988
      }
883
      iprot.readFieldEnd();
989
      iprot.readFieldEnd();
884
    }
990
    }
Line 917... Line 1023...
917
    oprot.writeDouble(this.actualPrice);
1023
    oprot.writeDouble(this.actualPrice);
918
    oprot.writeFieldEnd();
1024
    oprot.writeFieldEnd();
919
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
1025
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
920
    oprot.writeDouble(this.discountedPrice);
1026
    oprot.writeDouble(this.discountedPrice);
921
    oprot.writeFieldEnd();
1027
    oprot.writeFieldEnd();
-
 
1028
    if (this.discounts != null) {
-
 
1029
      oprot.writeFieldBegin(DISCOUNTS_FIELD_DESC);
-
 
1030
      {
-
 
1031
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.discounts.size()));
-
 
1032
        for (Discount _iter11 : this.discounts)
-
 
1033
        {
-
 
1034
          _iter11.write(oprot);
-
 
1035
        }
-
 
1036
        oprot.writeListEnd();
-
 
1037
      }
-
 
1038
      oprot.writeFieldEnd();
-
 
1039
    }
922
    oprot.writeFieldStop();
1040
    oprot.writeFieldStop();
923
    oprot.writeStructEnd();
1041
    oprot.writeStructEnd();
924
  }
1042
  }
925
 
1043
 
926
  @Override
1044
  @Override
Line 965... Line 1083...
965
    first = false;
1083
    first = false;
966
    if (!first) sb.append(", ");
1084
    if (!first) sb.append(", ");
967
    sb.append("discountedPrice:");
1085
    sb.append("discountedPrice:");
968
    sb.append(this.discountedPrice);
1086
    sb.append(this.discountedPrice);
969
    first = false;
1087
    first = false;
-
 
1088
    if (!first) sb.append(", ");
-
 
1089
    sb.append("discounts:");
-
 
1090
    if (this.discounts == null) {
-
 
1091
      sb.append("null");
-
 
1092
    } else {
-
 
1093
      sb.append(this.discounts);
-
 
1094
    }
-
 
1095
    first = false;
970
    sb.append(")");
1096
    sb.append(")");
971
    return sb.toString();
1097
    return sb.toString();
972
  }
1098
  }
973
 
1099
 
974
  public void validate() throws org.apache.thrift.TException {
1100
  public void validate() throws org.apache.thrift.TException {