Subversion Repositories SmartDukaan

Rev

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

Rev 5553 Rev 6736
Line 32... Line 32...
32
  private static final org.apache.thrift.protocol.TField ADDRESS_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("addressId", org.apache.thrift.protocol.TType.I64, (short)7);
32
  private static final org.apache.thrift.protocol.TField ADDRESS_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("addressId", org.apache.thrift.protocol.TType.I64, (short)7);
33
  private static final org.apache.thrift.protocol.TField TOTAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("totalPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
33
  private static final org.apache.thrift.protocol.TField TOTAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("totalPrice", 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 COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)10);
35
  private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)10);
36
  private static final org.apache.thrift.protocol.TField PICKUP_STORE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("pickupStoreId", org.apache.thrift.protocol.TType.I64, (short)11);
36
  private static final org.apache.thrift.protocol.TField PICKUP_STORE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("pickupStoreId", org.apache.thrift.protocol.TType.I64, (short)11);
-
 
37
  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)12);
37
 
38
 
38
  private long id; // required
39
  private long id; // required
39
  private List<Line> lines; // required
40
  private List<Line> lines; // required
40
  private CartStatus status; // required
41
  private CartStatus status; // required
41
  private long createdOn; // required
42
  private long createdOn; // required
Line 44... Line 45...
44
  private long addressId; // required
45
  private long addressId; // required
45
  private double totalPrice; // required
46
  private double totalPrice; // required
46
  private double discountedPrice; // required
47
  private double discountedPrice; // required
47
  private String couponCode; // required
48
  private String couponCode; // required
48
  private long pickupStoreId; // required
49
  private long pickupStoreId; // required
-
 
50
  private String message; // required
49
 
51
 
50
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
52
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
51
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
53
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
52
    ID((short)1, "id"),
54
    ID((short)1, "id"),
53
    LINES((short)2, "lines"),
55
    LINES((short)2, "lines"),
Line 61... Line 63...
61
    CHECKED_OUT_ON((short)6, "checkedOutOn"),
63
    CHECKED_OUT_ON((short)6, "checkedOutOn"),
62
    ADDRESS_ID((short)7, "addressId"),
64
    ADDRESS_ID((short)7, "addressId"),
63
    TOTAL_PRICE((short)8, "totalPrice"),
65
    TOTAL_PRICE((short)8, "totalPrice"),
64
    DISCOUNTED_PRICE((short)9, "discountedPrice"),
66
    DISCOUNTED_PRICE((short)9, "discountedPrice"),
65
    COUPON_CODE((short)10, "couponCode"),
67
    COUPON_CODE((short)10, "couponCode"),
66
    PICKUP_STORE_ID((short)11, "pickupStoreId");
68
    PICKUP_STORE_ID((short)11, "pickupStoreId"),
-
 
69
    MESSAGE((short)12, "message");
67
 
70
 
68
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
71
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
69
 
72
 
70
    static {
73
    static {
71
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
74
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 98... Line 101...
98
          return DISCOUNTED_PRICE;
101
          return DISCOUNTED_PRICE;
99
        case 10: // COUPON_CODE
102
        case 10: // COUPON_CODE
100
          return COUPON_CODE;
103
          return COUPON_CODE;
101
        case 11: // PICKUP_STORE_ID
104
        case 11: // PICKUP_STORE_ID
102
          return PICKUP_STORE_ID;
105
          return PICKUP_STORE_ID;
-
 
106
        case 12: // MESSAGE
-
 
107
          return MESSAGE;
103
        default:
108
        default:
104
          return null;
109
          return null;
105
      }
110
      }
106
    }
111
    }
107
 
112
 
Line 174... Line 179...
174
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
179
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
175
    tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
180
    tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
176
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
181
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
177
    tmpMap.put(_Fields.PICKUP_STORE_ID, new org.apache.thrift.meta_data.FieldMetaData("pickupStoreId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
182
    tmpMap.put(_Fields.PICKUP_STORE_ID, new org.apache.thrift.meta_data.FieldMetaData("pickupStoreId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
178
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
183
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
184
    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
185
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
179
    metaDataMap = Collections.unmodifiableMap(tmpMap);
186
    metaDataMap = Collections.unmodifiableMap(tmpMap);
180
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Cart.class, metaDataMap);
187
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Cart.class, metaDataMap);
181
  }
188
  }
182
 
189
 
183
  public Cart() {
190
  public Cart() {
Line 192... Line 199...
192
    long checkedOutOn,
199
    long checkedOutOn,
193
    long addressId,
200
    long addressId,
194
    double totalPrice,
201
    double totalPrice,
195
    double discountedPrice,
202
    double discountedPrice,
196
    String couponCode,
203
    String couponCode,
197
    long pickupStoreId)
204
    long pickupStoreId,
-
 
205
    String message)
198
  {
206
  {
199
    this();
207
    this();
200
    this.id = id;
208
    this.id = id;
201
    setIdIsSet(true);
209
    setIdIsSet(true);
202
    this.lines = lines;
210
    this.lines = lines;
Line 214... Line 222...
214
    this.discountedPrice = discountedPrice;
222
    this.discountedPrice = discountedPrice;
215
    setDiscountedPriceIsSet(true);
223
    setDiscountedPriceIsSet(true);
216
    this.couponCode = couponCode;
224
    this.couponCode = couponCode;
217
    this.pickupStoreId = pickupStoreId;
225
    this.pickupStoreId = pickupStoreId;
218
    setPickupStoreIdIsSet(true);
226
    setPickupStoreIdIsSet(true);
-
 
227
    this.message = message;
219
  }
228
  }
220
 
229
 
221
  /**
230
  /**
222
   * Performs a deep copy on <i>other</i>.
231
   * Performs a deep copy on <i>other</i>.
223
   */
232
   */
Line 243... Line 252...
243
    this.discountedPrice = other.discountedPrice;
252
    this.discountedPrice = other.discountedPrice;
244
    if (other.isSetCouponCode()) {
253
    if (other.isSetCouponCode()) {
245
      this.couponCode = other.couponCode;
254
      this.couponCode = other.couponCode;
246
    }
255
    }
247
    this.pickupStoreId = other.pickupStoreId;
256
    this.pickupStoreId = other.pickupStoreId;
-
 
257
    if (other.isSetMessage()) {
-
 
258
      this.message = other.message;
-
 
259
    }
248
  }
260
  }
249
 
261
 
250
  public Cart deepCopy() {
262
  public Cart deepCopy() {
251
    return new Cart(this);
263
    return new Cart(this);
252
  }
264
  }
Line 270... Line 282...
270
    setDiscountedPriceIsSet(false);
282
    setDiscountedPriceIsSet(false);
271
    this.discountedPrice = 0.0;
283
    this.discountedPrice = 0.0;
272
    this.couponCode = null;
284
    this.couponCode = null;
273
    setPickupStoreIdIsSet(false);
285
    setPickupStoreIdIsSet(false);
274
    this.pickupStoreId = 0;
286
    this.pickupStoreId = 0;
-
 
287
    this.message = null;
275
  }
288
  }
276
 
289
 
277
  public long getId() {
290
  public long getId() {
278
    return this.id;
291
    return this.id;
279
  }
292
  }
Line 540... Line 553...
540
 
553
 
541
  public void setPickupStoreIdIsSet(boolean value) {
554
  public void setPickupStoreIdIsSet(boolean value) {
542
    __isset_bit_vector.set(__PICKUPSTOREID_ISSET_ID, value);
555
    __isset_bit_vector.set(__PICKUPSTOREID_ISSET_ID, value);
543
  }
556
  }
544
 
557
 
-
 
558
  public String getMessage() {
-
 
559
    return this.message;
-
 
560
  }
-
 
561
 
-
 
562
  public void setMessage(String message) {
-
 
563
    this.message = message;
-
 
564
  }
-
 
565
 
-
 
566
  public void unsetMessage() {
-
 
567
    this.message = null;
-
 
568
  }
-
 
569
 
-
 
570
  /** Returns true if field message is set (has been assigned a value) and false otherwise */
-
 
571
  public boolean isSetMessage() {
-
 
572
    return this.message != null;
-
 
573
  }
-
 
574
 
-
 
575
  public void setMessageIsSet(boolean value) {
-
 
576
    if (!value) {
-
 
577
      this.message = null;
-
 
578
    }
-
 
579
  }
-
 
580
 
545
  public void setFieldValue(_Fields field, Object value) {
581
  public void setFieldValue(_Fields field, Object value) {
546
    switch (field) {
582
    switch (field) {
547
    case ID:
583
    case ID:
548
      if (value == null) {
584
      if (value == null) {
549
        unsetId();
585
        unsetId();
Line 630... Line 666...
630
      } else {
666
      } else {
631
        setPickupStoreId((Long)value);
667
        setPickupStoreId((Long)value);
632
      }
668
      }
633
      break;
669
      break;
634
 
670
 
-
 
671
    case MESSAGE:
-
 
672
      if (value == null) {
-
 
673
        unsetMessage();
-
 
674
      } else {
-
 
675
        setMessage((String)value);
-
 
676
      }
-
 
677
      break;
-
 
678
 
635
    }
679
    }
636
  }
680
  }
637
 
681
 
638
  public Object getFieldValue(_Fields field) {
682
  public Object getFieldValue(_Fields field) {
639
    switch (field) {
683
    switch (field) {
Line 668... Line 712...
668
      return getCouponCode();
712
      return getCouponCode();
669
 
713
 
670
    case PICKUP_STORE_ID:
714
    case PICKUP_STORE_ID:
671
      return Long.valueOf(getPickupStoreId());
715
      return Long.valueOf(getPickupStoreId());
672
 
716
 
-
 
717
    case MESSAGE:
-
 
718
      return getMessage();
-
 
719
 
673
    }
720
    }
674
    throw new IllegalStateException();
721
    throw new IllegalStateException();
675
  }
722
  }
676
 
723
 
677
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
724
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 701... Line 748...
701
      return isSetDiscountedPrice();
748
      return isSetDiscountedPrice();
702
    case COUPON_CODE:
749
    case COUPON_CODE:
703
      return isSetCouponCode();
750
      return isSetCouponCode();
704
    case PICKUP_STORE_ID:
751
    case PICKUP_STORE_ID:
705
      return isSetPickupStoreId();
752
      return isSetPickupStoreId();
-
 
753
    case MESSAGE:
-
 
754
      return isSetMessage();
706
    }
755
    }
707
    throw new IllegalStateException();
756
    throw new IllegalStateException();
708
  }
757
  }
709
 
758
 
710
  @Override
759
  @Override
Line 817... Line 866...
817
        return false;
866
        return false;
818
      if (this.pickupStoreId != that.pickupStoreId)
867
      if (this.pickupStoreId != that.pickupStoreId)
819
        return false;
868
        return false;
820
    }
869
    }
821
 
870
 
-
 
871
    boolean this_present_message = true && this.isSetMessage();
-
 
872
    boolean that_present_message = true && that.isSetMessage();
-
 
873
    if (this_present_message || that_present_message) {
-
 
874
      if (!(this_present_message && that_present_message))
-
 
875
        return false;
-
 
876
      if (!this.message.equals(that.message))
-
 
877
        return false;
-
 
878
    }
-
 
879
 
822
    return true;
880
    return true;
823
  }
881
  }
824
 
882
 
825
  @Override
883
  @Override
826
  public int hashCode() {
884
  public int hashCode() {
Line 943... Line 1001...
943
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pickupStoreId, typedOther.pickupStoreId);
1001
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pickupStoreId, typedOther.pickupStoreId);
944
      if (lastComparison != 0) {
1002
      if (lastComparison != 0) {
945
        return lastComparison;
1003
        return lastComparison;
946
      }
1004
      }
947
    }
1005
    }
-
 
1006
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
-
 
1007
    if (lastComparison != 0) {
-
 
1008
      return lastComparison;
-
 
1009
    }
-
 
1010
    if (isSetMessage()) {
-
 
1011
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
-
 
1012
      if (lastComparison != 0) {
-
 
1013
        return lastComparison;
-
 
1014
      }
-
 
1015
    }
948
    return 0;
1016
    return 0;
949
  }
1017
  }
950
 
1018
 
951
  public _Fields fieldForId(int fieldId) {
1019
  public _Fields fieldForId(int fieldId) {
952
    return _Fields.findByThriftId(fieldId);
1020
    return _Fields.findByThriftId(fieldId);
Line 1056... Line 1124...
1056
            setPickupStoreIdIsSet(true);
1124
            setPickupStoreIdIsSet(true);
1057
          } else { 
1125
          } else { 
1058
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1126
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1059
          }
1127
          }
1060
          break;
1128
          break;
-
 
1129
        case 12: // MESSAGE
-
 
1130
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-
 
1131
            this.message = iprot.readString();
-
 
1132
          } else { 
-
 
1133
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
1134
          }
-
 
1135
          break;
1061
        default:
1136
        default:
1062
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1137
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1063
      }
1138
      }
1064
      iprot.readFieldEnd();
1139
      iprot.readFieldEnd();
1065
    }
1140
    }
Line 1115... Line 1190...
1115
      oprot.writeFieldEnd();
1190
      oprot.writeFieldEnd();
1116
    }
1191
    }
1117
    oprot.writeFieldBegin(PICKUP_STORE_ID_FIELD_DESC);
1192
    oprot.writeFieldBegin(PICKUP_STORE_ID_FIELD_DESC);
1118
    oprot.writeI64(this.pickupStoreId);
1193
    oprot.writeI64(this.pickupStoreId);
1119
    oprot.writeFieldEnd();
1194
    oprot.writeFieldEnd();
-
 
1195
    if (this.message != null) {
-
 
1196
      oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
-
 
1197
      oprot.writeString(this.message);
-
 
1198
      oprot.writeFieldEnd();
-
 
1199
    }
1120
    oprot.writeFieldStop();
1200
    oprot.writeFieldStop();
1121
    oprot.writeStructEnd();
1201
    oprot.writeStructEnd();
1122
  }
1202
  }
1123
 
1203
 
1124
  @Override
1204
  @Override
Line 1179... Line 1259...
1179
    first = false;
1259
    first = false;
1180
    if (!first) sb.append(", ");
1260
    if (!first) sb.append(", ");
1181
    sb.append("pickupStoreId:");
1261
    sb.append("pickupStoreId:");
1182
    sb.append(this.pickupStoreId);
1262
    sb.append(this.pickupStoreId);
1183
    first = false;
1263
    first = false;
-
 
1264
    if (!first) sb.append(", ");
-
 
1265
    sb.append("message:");
-
 
1266
    if (this.message == null) {
-
 
1267
      sb.append("null");
-
 
1268
    } else {
-
 
1269
      sb.append(this.message);
-
 
1270
    }
-
 
1271
    first = false;
1184
    sb.append(")");
1272
    sb.append(")");
1185
    return sb.toString();
1273
    return sb.toString();
1186
  }
1274
  }
1187
 
1275
 
1188
  public void validate() throws org.apache.thrift.TException {
1276
  public void validate() throws org.apache.thrift.TException {