Subversion Repositories SmartDukaan

Rev

Rev 3555 | Rev 5553 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
553 chandransh 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
553 chandransh 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
553 chandransh 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
3430 rajveer 23
public class Cart implements org.apache.thrift.TBase<Cart, Cart._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Cart");
553 chandransh 25
 
3430 rajveer 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 LINES_FIELD_DESC = new org.apache.thrift.protocol.TField("lines", org.apache.thrift.protocol.TType.LIST, (short)2);
28
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)3);
29
  private static final org.apache.thrift.protocol.TField CREATED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("createdOn", org.apache.thrift.protocol.TType.I64, (short)4);
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 CHECKED_OUT_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("checkedOutOn", org.apache.thrift.protocol.TType.I64, (short)6);
5327 rajveer 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);
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);
553 chandransh 36
 
3430 rajveer 37
  private long id; // required
38
  private List<Line> lines; // required
39
  private CartStatus status; // required
40
  private long createdOn; // required
41
  private long updatedOn; // required
42
  private long checkedOutOn; // required
43
  private long addressId; // required
44
  private double totalPrice; // required
45
  private double discountedPrice; // required
46
  private String couponCode; // required
553 chandransh 47
 
48
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 49
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
553 chandransh 50
    ID((short)1, "id"),
51
    LINES((short)2, "lines"),
52
    /**
53
     * 
54
     * @see CartStatus
55
     */
56
    STATUS((short)3, "status"),
57
    CREATED_ON((short)4, "createdOn"),
58
    UPDATED_ON((short)5, "updatedOn"),
688 chandransh 59
    CHECKED_OUT_ON((short)6, "checkedOutOn"),
5327 rajveer 60
    ADDRESS_ID((short)7, "addressId"),
61
    TOTAL_PRICE((short)8, "totalPrice"),
62
    DISCOUNTED_PRICE((short)9, "discountedPrice"),
63
    COUPON_CODE((short)10, "couponCode");
553 chandransh 64
 
65
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
66
 
67
    static {
68
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
69
        byName.put(field.getFieldName(), field);
70
      }
71
    }
72
 
73
    /**
74
     * Find the _Fields constant that matches fieldId, or null if its not found.
75
     */
76
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 77
      switch(fieldId) {
78
        case 1: // ID
79
          return ID;
80
        case 2: // LINES
81
          return LINES;
82
        case 3: // STATUS
83
          return STATUS;
84
        case 4: // CREATED_ON
85
          return CREATED_ON;
86
        case 5: // UPDATED_ON
87
          return UPDATED_ON;
88
        case 6: // CHECKED_OUT_ON
89
          return CHECKED_OUT_ON;
5327 rajveer 90
        case 7: // ADDRESS_ID
3430 rajveer 91
          return ADDRESS_ID;
5327 rajveer 92
        case 8: // TOTAL_PRICE
3430 rajveer 93
          return TOTAL_PRICE;
5327 rajveer 94
        case 9: // DISCOUNTED_PRICE
3430 rajveer 95
          return DISCOUNTED_PRICE;
5327 rajveer 96
        case 10: // COUPON_CODE
3430 rajveer 97
          return COUPON_CODE;
98
        default:
99
          return null;
100
      }
553 chandransh 101
    }
102
 
103
    /**
104
     * Find the _Fields constant that matches fieldId, throwing an exception
105
     * if it is not found.
106
     */
107
    public static _Fields findByThriftIdOrThrow(int fieldId) {
108
      _Fields fields = findByThriftId(fieldId);
109
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
110
      return fields;
111
    }
112
 
113
    /**
114
     * Find the _Fields constant that matches name, or null if its not found.
115
     */
116
    public static _Fields findByName(String name) {
117
      return byName.get(name);
118
    }
119
 
120
    private final short _thriftId;
121
    private final String _fieldName;
122
 
123
    _Fields(short thriftId, String fieldName) {
124
      _thriftId = thriftId;
125
      _fieldName = fieldName;
126
    }
127
 
128
    public short getThriftFieldId() {
129
      return _thriftId;
130
    }
131
 
132
    public String getFieldName() {
133
      return _fieldName;
134
    }
135
  }
136
 
137
  // isset id assignments
138
  private static final int __ID_ISSET_ID = 0;
139
  private static final int __CREATEDON_ISSET_ID = 1;
140
  private static final int __UPDATEDON_ISSET_ID = 2;
688 chandransh 141
  private static final int __CHECKEDOUTON_ISSET_ID = 3;
5327 rajveer 142
  private static final int __ADDRESSID_ISSET_ID = 4;
143
  private static final int __TOTALPRICE_ISSET_ID = 5;
144
  private static final int __DISCOUNTEDPRICE_ISSET_ID = 6;
145
  private BitSet __isset_bit_vector = new BitSet(7);
553 chandransh 146
 
3430 rajveer 147
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
553 chandransh 148
  static {
3430 rajveer 149
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
150
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
152
    tmpMap.put(_Fields.LINES, new org.apache.thrift.meta_data.FieldMetaData("lines", org.apache.thrift.TFieldRequirementType.DEFAULT, 
153
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
154
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Line.class))));
155
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CartStatus.class)));
157
    tmpMap.put(_Fields.CREATED_ON, new org.apache.thrift.meta_data.FieldMetaData("createdOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
159
    tmpMap.put(_Fields.UPDATED_ON, new org.apache.thrift.meta_data.FieldMetaData("updatedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
160
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
161
    tmpMap.put(_Fields.CHECKED_OUT_ON, new org.apache.thrift.meta_data.FieldMetaData("checkedOutOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
162
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
163
    tmpMap.put(_Fields.ADDRESS_ID, new org.apache.thrift.meta_data.FieldMetaData("addressId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
164
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
165
    tmpMap.put(_Fields.TOTAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("totalPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
166
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
167
    tmpMap.put(_Fields.DISCOUNTED_PRICE, new org.apache.thrift.meta_data.FieldMetaData("discountedPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
168
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
169
    tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
170
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
171
    metaDataMap = Collections.unmodifiableMap(tmpMap);
172
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Cart.class, metaDataMap);
553 chandransh 173
  }
174
 
175
  public Cart() {
176
  }
177
 
178
  public Cart(
179
    long id,
180
    List<Line> lines,
181
    CartStatus status,
182
    long createdOn,
183
    long updatedOn,
688 chandransh 184
    long checkedOutOn,
1982 varun.gupt 185
    long addressId,
186
    double totalPrice,
187
    double discountedPrice,
188
    String couponCode)
553 chandransh 189
  {
190
    this();
191
    this.id = id;
192
    setIdIsSet(true);
193
    this.lines = lines;
194
    this.status = status;
195
    this.createdOn = createdOn;
196
    setCreatedOnIsSet(true);
197
    this.updatedOn = updatedOn;
198
    setUpdatedOnIsSet(true);
688 chandransh 199
    this.checkedOutOn = checkedOutOn;
200
    setCheckedOutOnIsSet(true);
553 chandransh 201
    this.addressId = addressId;
202
    setAddressIdIsSet(true);
1982 varun.gupt 203
    this.totalPrice = totalPrice;
204
    setTotalPriceIsSet(true);
205
    this.discountedPrice = discountedPrice;
206
    setDiscountedPriceIsSet(true);
207
    this.couponCode = couponCode;
553 chandransh 208
  }
209
 
210
  /**
211
   * Performs a deep copy on <i>other</i>.
212
   */
213
  public Cart(Cart other) {
214
    __isset_bit_vector.clear();
215
    __isset_bit_vector.or(other.__isset_bit_vector);
216
    this.id = other.id;
217
    if (other.isSetLines()) {
218
      List<Line> __this__lines = new ArrayList<Line>();
219
      for (Line other_element : other.lines) {
220
        __this__lines.add(new Line(other_element));
221
      }
222
      this.lines = __this__lines;
223
    }
224
    if (other.isSetStatus()) {
225
      this.status = other.status;
226
    }
227
    this.createdOn = other.createdOn;
228
    this.updatedOn = other.updatedOn;
688 chandransh 229
    this.checkedOutOn = other.checkedOutOn;
553 chandransh 230
    this.addressId = other.addressId;
1982 varun.gupt 231
    this.totalPrice = other.totalPrice;
232
    this.discountedPrice = other.discountedPrice;
233
    if (other.isSetCouponCode()) {
234
      this.couponCode = other.couponCode;
235
    }
553 chandransh 236
  }
237
 
238
  public Cart deepCopy() {
239
    return new Cart(this);
240
  }
241
 
3430 rajveer 242
  @Override
243
  public void clear() {
244
    setIdIsSet(false);
245
    this.id = 0;
246
    this.lines = null;
247
    this.status = null;
248
    setCreatedOnIsSet(false);
249
    this.createdOn = 0;
250
    setUpdatedOnIsSet(false);
251
    this.updatedOn = 0;
252
    setCheckedOutOnIsSet(false);
253
    this.checkedOutOn = 0;
254
    setAddressIdIsSet(false);
255
    this.addressId = 0;
256
    setTotalPriceIsSet(false);
257
    this.totalPrice = 0.0;
258
    setDiscountedPriceIsSet(false);
259
    this.discountedPrice = 0.0;
260
    this.couponCode = null;
553 chandransh 261
  }
262
 
263
  public long getId() {
264
    return this.id;
265
  }
266
 
3430 rajveer 267
  public void setId(long id) {
553 chandransh 268
    this.id = id;
269
    setIdIsSet(true);
270
  }
271
 
272
  public void unsetId() {
273
    __isset_bit_vector.clear(__ID_ISSET_ID);
274
  }
275
 
3430 rajveer 276
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
553 chandransh 277
  public boolean isSetId() {
278
    return __isset_bit_vector.get(__ID_ISSET_ID);
279
  }
280
 
281
  public void setIdIsSet(boolean value) {
282
    __isset_bit_vector.set(__ID_ISSET_ID, value);
283
  }
284
 
285
  public int getLinesSize() {
286
    return (this.lines == null) ? 0 : this.lines.size();
287
  }
288
 
289
  public java.util.Iterator<Line> getLinesIterator() {
290
    return (this.lines == null) ? null : this.lines.iterator();
291
  }
292
 
293
  public void addToLines(Line elem) {
294
    if (this.lines == null) {
295
      this.lines = new ArrayList<Line>();
296
    }
297
    this.lines.add(elem);
298
  }
299
 
300
  public List<Line> getLines() {
301
    return this.lines;
302
  }
303
 
3430 rajveer 304
  public void setLines(List<Line> lines) {
553 chandransh 305
    this.lines = lines;
306
  }
307
 
308
  public void unsetLines() {
309
    this.lines = null;
310
  }
311
 
3430 rajveer 312
  /** Returns true if field lines is set (has been assigned a value) and false otherwise */
553 chandransh 313
  public boolean isSetLines() {
314
    return this.lines != null;
315
  }
316
 
317
  public void setLinesIsSet(boolean value) {
318
    if (!value) {
319
      this.lines = null;
320
    }
321
  }
322
 
323
  /**
324
   * 
325
   * @see CartStatus
326
   */
327
  public CartStatus getStatus() {
328
    return this.status;
329
  }
330
 
331
  /**
332
   * 
333
   * @see CartStatus
334
   */
3430 rajveer 335
  public void setStatus(CartStatus status) {
553 chandransh 336
    this.status = status;
337
  }
338
 
339
  public void unsetStatus() {
340
    this.status = null;
341
  }
342
 
3430 rajveer 343
  /** Returns true if field status is set (has been assigned a value) and false otherwise */
553 chandransh 344
  public boolean isSetStatus() {
345
    return this.status != null;
346
  }
347
 
348
  public void setStatusIsSet(boolean value) {
349
    if (!value) {
350
      this.status = null;
351
    }
352
  }
353
 
354
  public long getCreatedOn() {
355
    return this.createdOn;
356
  }
357
 
3430 rajveer 358
  public void setCreatedOn(long createdOn) {
553 chandransh 359
    this.createdOn = createdOn;
360
    setCreatedOnIsSet(true);
361
  }
362
 
363
  public void unsetCreatedOn() {
364
    __isset_bit_vector.clear(__CREATEDON_ISSET_ID);
365
  }
366
 
3430 rajveer 367
  /** Returns true if field createdOn is set (has been assigned a value) and false otherwise */
553 chandransh 368
  public boolean isSetCreatedOn() {
369
    return __isset_bit_vector.get(__CREATEDON_ISSET_ID);
370
  }
371
 
372
  public void setCreatedOnIsSet(boolean value) {
373
    __isset_bit_vector.set(__CREATEDON_ISSET_ID, value);
374
  }
375
 
376
  public long getUpdatedOn() {
377
    return this.updatedOn;
378
  }
379
 
3430 rajveer 380
  public void setUpdatedOn(long updatedOn) {
553 chandransh 381
    this.updatedOn = updatedOn;
382
    setUpdatedOnIsSet(true);
383
  }
384
 
385
  public void unsetUpdatedOn() {
386
    __isset_bit_vector.clear(__UPDATEDON_ISSET_ID);
387
  }
388
 
3430 rajveer 389
  /** Returns true if field updatedOn is set (has been assigned a value) and false otherwise */
553 chandransh 390
  public boolean isSetUpdatedOn() {
391
    return __isset_bit_vector.get(__UPDATEDON_ISSET_ID);
392
  }
393
 
394
  public void setUpdatedOnIsSet(boolean value) {
395
    __isset_bit_vector.set(__UPDATEDON_ISSET_ID, value);
396
  }
397
 
688 chandransh 398
  public long getCheckedOutOn() {
399
    return this.checkedOutOn;
553 chandransh 400
  }
401
 
3430 rajveer 402
  public void setCheckedOutOn(long checkedOutOn) {
688 chandransh 403
    this.checkedOutOn = checkedOutOn;
404
    setCheckedOutOnIsSet(true);
553 chandransh 405
  }
406
 
688 chandransh 407
  public void unsetCheckedOutOn() {
408
    __isset_bit_vector.clear(__CHECKEDOUTON_ISSET_ID);
553 chandransh 409
  }
410
 
3430 rajveer 411
  /** Returns true if field checkedOutOn is set (has been assigned a value) and false otherwise */
688 chandransh 412
  public boolean isSetCheckedOutOn() {
413
    return __isset_bit_vector.get(__CHECKEDOUTON_ISSET_ID);
553 chandransh 414
  }
415
 
688 chandransh 416
  public void setCheckedOutOnIsSet(boolean value) {
417
    __isset_bit_vector.set(__CHECKEDOUTON_ISSET_ID, value);
553 chandransh 418
  }
419
 
420
  public long getAddressId() {
421
    return this.addressId;
422
  }
423
 
3430 rajveer 424
  public void setAddressId(long addressId) {
553 chandransh 425
    this.addressId = addressId;
426
    setAddressIdIsSet(true);
427
  }
428
 
429
  public void unsetAddressId() {
430
    __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
431
  }
432
 
3430 rajveer 433
  /** Returns true if field addressId is set (has been assigned a value) and false otherwise */
553 chandransh 434
  public boolean isSetAddressId() {
435
    return __isset_bit_vector.get(__ADDRESSID_ISSET_ID);
436
  }
437
 
438
  public void setAddressIdIsSet(boolean value) {
439
    __isset_bit_vector.set(__ADDRESSID_ISSET_ID, value);
440
  }
441
 
1982 varun.gupt 442
  public double getTotalPrice() {
443
    return this.totalPrice;
444
  }
445
 
3430 rajveer 446
  public void setTotalPrice(double totalPrice) {
1982 varun.gupt 447
    this.totalPrice = totalPrice;
448
    setTotalPriceIsSet(true);
449
  }
450
 
451
  public void unsetTotalPrice() {
452
    __isset_bit_vector.clear(__TOTALPRICE_ISSET_ID);
453
  }
454
 
3430 rajveer 455
  /** Returns true if field totalPrice is set (has been assigned a value) and false otherwise */
1982 varun.gupt 456
  public boolean isSetTotalPrice() {
457
    return __isset_bit_vector.get(__TOTALPRICE_ISSET_ID);
458
  }
459
 
460
  public void setTotalPriceIsSet(boolean value) {
461
    __isset_bit_vector.set(__TOTALPRICE_ISSET_ID, value);
462
  }
463
 
464
  public double getDiscountedPrice() {
465
    return this.discountedPrice;
466
  }
467
 
3430 rajveer 468
  public void setDiscountedPrice(double discountedPrice) {
1982 varun.gupt 469
    this.discountedPrice = discountedPrice;
470
    setDiscountedPriceIsSet(true);
471
  }
472
 
473
  public void unsetDiscountedPrice() {
474
    __isset_bit_vector.clear(__DISCOUNTEDPRICE_ISSET_ID);
475
  }
476
 
3430 rajveer 477
  /** Returns true if field discountedPrice is set (has been assigned a value) and false otherwise */
1982 varun.gupt 478
  public boolean isSetDiscountedPrice() {
479
    return __isset_bit_vector.get(__DISCOUNTEDPRICE_ISSET_ID);
480
  }
481
 
482
  public void setDiscountedPriceIsSet(boolean value) {
483
    __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
484
  }
485
 
486
  public String getCouponCode() {
487
    return this.couponCode;
488
  }
489
 
3430 rajveer 490
  public void setCouponCode(String couponCode) {
1982 varun.gupt 491
    this.couponCode = couponCode;
492
  }
493
 
494
  public void unsetCouponCode() {
495
    this.couponCode = null;
496
  }
497
 
3430 rajveer 498
  /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 499
  public boolean isSetCouponCode() {
500
    return this.couponCode != null;
501
  }
502
 
503
  public void setCouponCodeIsSet(boolean value) {
504
    if (!value) {
505
      this.couponCode = null;
506
    }
507
  }
508
 
553 chandransh 509
  public void setFieldValue(_Fields field, Object value) {
510
    switch (field) {
511
    case ID:
512
      if (value == null) {
513
        unsetId();
514
      } else {
515
        setId((Long)value);
516
      }
517
      break;
518
 
519
    case LINES:
520
      if (value == null) {
521
        unsetLines();
522
      } else {
523
        setLines((List<Line>)value);
524
      }
525
      break;
526
 
527
    case STATUS:
528
      if (value == null) {
529
        unsetStatus();
530
      } else {
531
        setStatus((CartStatus)value);
532
      }
533
      break;
534
 
535
    case CREATED_ON:
536
      if (value == null) {
537
        unsetCreatedOn();
538
      } else {
539
        setCreatedOn((Long)value);
540
      }
541
      break;
542
 
543
    case UPDATED_ON:
544
      if (value == null) {
545
        unsetUpdatedOn();
546
      } else {
547
        setUpdatedOn((Long)value);
548
      }
549
      break;
550
 
688 chandransh 551
    case CHECKED_OUT_ON:
553 chandransh 552
      if (value == null) {
688 chandransh 553
        unsetCheckedOutOn();
553 chandransh 554
      } else {
688 chandransh 555
        setCheckedOutOn((Long)value);
553 chandransh 556
      }
557
      break;
558
 
559
    case ADDRESS_ID:
560
      if (value == null) {
561
        unsetAddressId();
562
      } else {
563
        setAddressId((Long)value);
564
      }
565
      break;
566
 
1982 varun.gupt 567
    case TOTAL_PRICE:
568
      if (value == null) {
569
        unsetTotalPrice();
570
      } else {
571
        setTotalPrice((Double)value);
572
      }
573
      break;
574
 
575
    case DISCOUNTED_PRICE:
576
      if (value == null) {
577
        unsetDiscountedPrice();
578
      } else {
579
        setDiscountedPrice((Double)value);
580
      }
581
      break;
582
 
583
    case COUPON_CODE:
584
      if (value == null) {
585
        unsetCouponCode();
586
      } else {
587
        setCouponCode((String)value);
588
      }
589
      break;
590
 
553 chandransh 591
    }
592
  }
593
 
594
  public Object getFieldValue(_Fields field) {
595
    switch (field) {
596
    case ID:
3430 rajveer 597
      return Long.valueOf(getId());
553 chandransh 598
 
599
    case LINES:
600
      return getLines();
601
 
602
    case STATUS:
603
      return getStatus();
604
 
605
    case CREATED_ON:
3430 rajveer 606
      return Long.valueOf(getCreatedOn());
553 chandransh 607
 
608
    case UPDATED_ON:
3430 rajveer 609
      return Long.valueOf(getUpdatedOn());
553 chandransh 610
 
688 chandransh 611
    case CHECKED_OUT_ON:
3430 rajveer 612
      return Long.valueOf(getCheckedOutOn());
553 chandransh 613
 
614
    case ADDRESS_ID:
3430 rajveer 615
      return Long.valueOf(getAddressId());
553 chandransh 616
 
1982 varun.gupt 617
    case TOTAL_PRICE:
3430 rajveer 618
      return Double.valueOf(getTotalPrice());
1982 varun.gupt 619
 
620
    case DISCOUNTED_PRICE:
3430 rajveer 621
      return Double.valueOf(getDiscountedPrice());
1982 varun.gupt 622
 
623
    case COUPON_CODE:
624
      return getCouponCode();
625
 
553 chandransh 626
    }
627
    throw new IllegalStateException();
628
  }
629
 
3430 rajveer 630
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
631
  public boolean isSet(_Fields field) {
632
    if (field == null) {
633
      throw new IllegalArgumentException();
634
    }
553 chandransh 635
 
636
    switch (field) {
637
    case ID:
638
      return isSetId();
639
    case LINES:
640
      return isSetLines();
641
    case STATUS:
642
      return isSetStatus();
643
    case CREATED_ON:
644
      return isSetCreatedOn();
645
    case UPDATED_ON:
646
      return isSetUpdatedOn();
688 chandransh 647
    case CHECKED_OUT_ON:
648
      return isSetCheckedOutOn();
553 chandransh 649
    case ADDRESS_ID:
650
      return isSetAddressId();
1982 varun.gupt 651
    case TOTAL_PRICE:
652
      return isSetTotalPrice();
653
    case DISCOUNTED_PRICE:
654
      return isSetDiscountedPrice();
655
    case COUPON_CODE:
656
      return isSetCouponCode();
553 chandransh 657
    }
658
    throw new IllegalStateException();
659
  }
660
 
661
  @Override
662
  public boolean equals(Object that) {
663
    if (that == null)
664
      return false;
665
    if (that instanceof Cart)
666
      return this.equals((Cart)that);
667
    return false;
668
  }
669
 
670
  public boolean equals(Cart that) {
671
    if (that == null)
672
      return false;
673
 
674
    boolean this_present_id = true;
675
    boolean that_present_id = true;
676
    if (this_present_id || that_present_id) {
677
      if (!(this_present_id && that_present_id))
678
        return false;
679
      if (this.id != that.id)
680
        return false;
681
    }
682
 
683
    boolean this_present_lines = true && this.isSetLines();
684
    boolean that_present_lines = true && that.isSetLines();
685
    if (this_present_lines || that_present_lines) {
686
      if (!(this_present_lines && that_present_lines))
687
        return false;
688
      if (!this.lines.equals(that.lines))
689
        return false;
690
    }
691
 
692
    boolean this_present_status = true && this.isSetStatus();
693
    boolean that_present_status = true && that.isSetStatus();
694
    if (this_present_status || that_present_status) {
695
      if (!(this_present_status && that_present_status))
696
        return false;
697
      if (!this.status.equals(that.status))
698
        return false;
699
    }
700
 
701
    boolean this_present_createdOn = true;
702
    boolean that_present_createdOn = true;
703
    if (this_present_createdOn || that_present_createdOn) {
704
      if (!(this_present_createdOn && that_present_createdOn))
705
        return false;
706
      if (this.createdOn != that.createdOn)
707
        return false;
708
    }
709
 
710
    boolean this_present_updatedOn = true;
711
    boolean that_present_updatedOn = true;
712
    if (this_present_updatedOn || that_present_updatedOn) {
713
      if (!(this_present_updatedOn && that_present_updatedOn))
714
        return false;
715
      if (this.updatedOn != that.updatedOn)
716
        return false;
717
    }
718
 
688 chandransh 719
    boolean this_present_checkedOutOn = true;
720
    boolean that_present_checkedOutOn = true;
721
    if (this_present_checkedOutOn || that_present_checkedOutOn) {
722
      if (!(this_present_checkedOutOn && that_present_checkedOutOn))
553 chandransh 723
        return false;
688 chandransh 724
      if (this.checkedOutOn != that.checkedOutOn)
553 chandransh 725
        return false;
726
    }
727
 
728
    boolean this_present_addressId = true;
729
    boolean that_present_addressId = true;
730
    if (this_present_addressId || that_present_addressId) {
731
      if (!(this_present_addressId && that_present_addressId))
732
        return false;
733
      if (this.addressId != that.addressId)
734
        return false;
735
    }
736
 
1982 varun.gupt 737
    boolean this_present_totalPrice = true;
738
    boolean that_present_totalPrice = true;
739
    if (this_present_totalPrice || that_present_totalPrice) {
740
      if (!(this_present_totalPrice && that_present_totalPrice))
741
        return false;
742
      if (this.totalPrice != that.totalPrice)
743
        return false;
744
    }
745
 
746
    boolean this_present_discountedPrice = true;
747
    boolean that_present_discountedPrice = true;
748
    if (this_present_discountedPrice || that_present_discountedPrice) {
749
      if (!(this_present_discountedPrice && that_present_discountedPrice))
750
        return false;
751
      if (this.discountedPrice != that.discountedPrice)
752
        return false;
753
    }
754
 
755
    boolean this_present_couponCode = true && this.isSetCouponCode();
756
    boolean that_present_couponCode = true && that.isSetCouponCode();
757
    if (this_present_couponCode || that_present_couponCode) {
758
      if (!(this_present_couponCode && that_present_couponCode))
759
        return false;
760
      if (!this.couponCode.equals(that.couponCode))
761
        return false;
762
    }
763
 
553 chandransh 764
    return true;
765
  }
766
 
767
  @Override
768
  public int hashCode() {
769
    return 0;
770
  }
771
 
772
  public int compareTo(Cart other) {
773
    if (!getClass().equals(other.getClass())) {
774
      return getClass().getName().compareTo(other.getClass().getName());
775
    }
776
 
777
    int lastComparison = 0;
778
    Cart typedOther = (Cart)other;
779
 
3430 rajveer 780
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
553 chandransh 781
    if (lastComparison != 0) {
782
      return lastComparison;
783
    }
3430 rajveer 784
    if (isSetId()) {
785
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
786
      if (lastComparison != 0) {
787
        return lastComparison;
788
      }
553 chandransh 789
    }
3430 rajveer 790
    lastComparison = Boolean.valueOf(isSetLines()).compareTo(typedOther.isSetLines());
553 chandransh 791
    if (lastComparison != 0) {
792
      return lastComparison;
793
    }
3430 rajveer 794
    if (isSetLines()) {
795
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lines, typedOther.lines);
796
      if (lastComparison != 0) {
797
        return lastComparison;
798
      }
553 chandransh 799
    }
3430 rajveer 800
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
553 chandransh 801
    if (lastComparison != 0) {
802
      return lastComparison;
803
    }
3430 rajveer 804
    if (isSetStatus()) {
805
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
806
      if (lastComparison != 0) {
807
        return lastComparison;
808
      }
553 chandransh 809
    }
3430 rajveer 810
    lastComparison = Boolean.valueOf(isSetCreatedOn()).compareTo(typedOther.isSetCreatedOn());
553 chandransh 811
    if (lastComparison != 0) {
812
      return lastComparison;
813
    }
3430 rajveer 814
    if (isSetCreatedOn()) {
815
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdOn, typedOther.createdOn);
816
      if (lastComparison != 0) {
817
        return lastComparison;
818
      }
553 chandransh 819
    }
3430 rajveer 820
    lastComparison = Boolean.valueOf(isSetUpdatedOn()).compareTo(typedOther.isSetUpdatedOn());
553 chandransh 821
    if (lastComparison != 0) {
822
      return lastComparison;
823
    }
3430 rajveer 824
    if (isSetUpdatedOn()) {
825
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedOn, typedOther.updatedOn);
826
      if (lastComparison != 0) {
827
        return lastComparison;
828
      }
553 chandransh 829
    }
3430 rajveer 830
    lastComparison = Boolean.valueOf(isSetCheckedOutOn()).compareTo(typedOther.isSetCheckedOutOn());
553 chandransh 831
    if (lastComparison != 0) {
832
      return lastComparison;
833
    }
3430 rajveer 834
    if (isSetCheckedOutOn()) {
835
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.checkedOutOn, typedOther.checkedOutOn);
836
      if (lastComparison != 0) {
837
        return lastComparison;
838
      }
553 chandransh 839
    }
3430 rajveer 840
    lastComparison = Boolean.valueOf(isSetAddressId()).compareTo(typedOther.isSetAddressId());
553 chandransh 841
    if (lastComparison != 0) {
842
      return lastComparison;
843
    }
3430 rajveer 844
    if (isSetAddressId()) {
845
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addressId, typedOther.addressId);
846
      if (lastComparison != 0) {
847
        return lastComparison;
848
      }
553 chandransh 849
    }
3430 rajveer 850
    lastComparison = Boolean.valueOf(isSetTotalPrice()).compareTo(typedOther.isSetTotalPrice());
1982 varun.gupt 851
    if (lastComparison != 0) {
852
      return lastComparison;
853
    }
3430 rajveer 854
    if (isSetTotalPrice()) {
855
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalPrice, typedOther.totalPrice);
856
      if (lastComparison != 0) {
857
        return lastComparison;
858
      }
1982 varun.gupt 859
    }
3430 rajveer 860
    lastComparison = Boolean.valueOf(isSetDiscountedPrice()).compareTo(typedOther.isSetDiscountedPrice());
1982 varun.gupt 861
    if (lastComparison != 0) {
862
      return lastComparison;
863
    }
3430 rajveer 864
    if (isSetDiscountedPrice()) {
865
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discountedPrice, typedOther.discountedPrice);
866
      if (lastComparison != 0) {
867
        return lastComparison;
868
      }
1982 varun.gupt 869
    }
3430 rajveer 870
    lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 871
    if (lastComparison != 0) {
872
      return lastComparison;
873
    }
3430 rajveer 874
    if (isSetCouponCode()) {
875
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
876
      if (lastComparison != 0) {
877
        return lastComparison;
878
      }
1982 varun.gupt 879
    }
553 chandransh 880
    return 0;
881
  }
882
 
3430 rajveer 883
  public _Fields fieldForId(int fieldId) {
884
    return _Fields.findByThriftId(fieldId);
885
  }
886
 
887
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
888
    org.apache.thrift.protocol.TField field;
553 chandransh 889
    iprot.readStructBegin();
890
    while (true)
891
    {
892
      field = iprot.readFieldBegin();
3430 rajveer 893
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
553 chandransh 894
        break;
895
      }
3430 rajveer 896
      switch (field.id) {
897
        case 1: // ID
898
          if (field.type == org.apache.thrift.protocol.TType.I64) {
899
            this.id = iprot.readI64();
900
            setIdIsSet(true);
901
          } else { 
902
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
903
          }
904
          break;
905
        case 2: // LINES
906
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
907
            {
5327 rajveer 908
              org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
909
              this.lines = new ArrayList<Line>(_list8.size);
910
              for (int _i9 = 0; _i9 < _list8.size; ++_i9)
553 chandransh 911
              {
5327 rajveer 912
                Line _elem10; // required
913
                _elem10 = new Line();
914
                _elem10.read(iprot);
915
                this.lines.add(_elem10);
553 chandransh 916
              }
3430 rajveer 917
              iprot.readListEnd();
553 chandransh 918
            }
3430 rajveer 919
          } else { 
920
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
921
          }
922
          break;
923
        case 3: // STATUS
924
          if (field.type == org.apache.thrift.protocol.TType.I32) {
925
            this.status = CartStatus.findByValue(iprot.readI32());
926
          } else { 
927
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
928
          }
929
          break;
930
        case 4: // CREATED_ON
931
          if (field.type == org.apache.thrift.protocol.TType.I64) {
932
            this.createdOn = iprot.readI64();
933
            setCreatedOnIsSet(true);
934
          } else { 
935
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
936
          }
937
          break;
938
        case 5: // UPDATED_ON
939
          if (field.type == org.apache.thrift.protocol.TType.I64) {
940
            this.updatedOn = iprot.readI64();
941
            setUpdatedOnIsSet(true);
942
          } else { 
943
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
944
          }
945
          break;
946
        case 6: // CHECKED_OUT_ON
947
          if (field.type == org.apache.thrift.protocol.TType.I64) {
948
            this.checkedOutOn = iprot.readI64();
949
            setCheckedOutOnIsSet(true);
950
          } else { 
951
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
952
          }
953
          break;
5327 rajveer 954
        case 7: // ADDRESS_ID
3430 rajveer 955
          if (field.type == org.apache.thrift.protocol.TType.I64) {
956
            this.addressId = iprot.readI64();
957
            setAddressIdIsSet(true);
958
          } else { 
959
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
960
          }
961
          break;
5327 rajveer 962
        case 8: // TOTAL_PRICE
3430 rajveer 963
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
964
            this.totalPrice = iprot.readDouble();
965
            setTotalPriceIsSet(true);
966
          } else { 
967
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
968
          }
969
          break;
5327 rajveer 970
        case 9: // DISCOUNTED_PRICE
3430 rajveer 971
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
972
            this.discountedPrice = iprot.readDouble();
973
            setDiscountedPriceIsSet(true);
974
          } else { 
975
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
976
          }
977
          break;
5327 rajveer 978
        case 10: // COUPON_CODE
3430 rajveer 979
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
980
            this.couponCode = iprot.readString();
981
          } else { 
982
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
983
          }
984
          break;
985
        default:
986
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
553 chandransh 987
      }
3430 rajveer 988
      iprot.readFieldEnd();
553 chandransh 989
    }
990
    iprot.readStructEnd();
991
    validate();
992
  }
993
 
3430 rajveer 994
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
553 chandransh 995
    validate();
996
 
997
    oprot.writeStructBegin(STRUCT_DESC);
998
    oprot.writeFieldBegin(ID_FIELD_DESC);
999
    oprot.writeI64(this.id);
1000
    oprot.writeFieldEnd();
1001
    if (this.lines != null) {
1002
      oprot.writeFieldBegin(LINES_FIELD_DESC);
1003
      {
3430 rajveer 1004
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.lines.size()));
5327 rajveer 1005
        for (Line _iter11 : this.lines)
553 chandransh 1006
        {
5327 rajveer 1007
          _iter11.write(oprot);
553 chandransh 1008
        }
1009
        oprot.writeListEnd();
1010
      }
1011
      oprot.writeFieldEnd();
1012
    }
1013
    if (this.status != null) {
1014
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
1015
      oprot.writeI32(this.status.getValue());
1016
      oprot.writeFieldEnd();
1017
    }
1018
    oprot.writeFieldBegin(CREATED_ON_FIELD_DESC);
1019
    oprot.writeI64(this.createdOn);
1020
    oprot.writeFieldEnd();
1021
    oprot.writeFieldBegin(UPDATED_ON_FIELD_DESC);
1022
    oprot.writeI64(this.updatedOn);
1023
    oprot.writeFieldEnd();
688 chandransh 1024
    oprot.writeFieldBegin(CHECKED_OUT_ON_FIELD_DESC);
1025
    oprot.writeI64(this.checkedOutOn);
553 chandransh 1026
    oprot.writeFieldEnd();
1027
    oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
1028
    oprot.writeI64(this.addressId);
1029
    oprot.writeFieldEnd();
1982 varun.gupt 1030
    oprot.writeFieldBegin(TOTAL_PRICE_FIELD_DESC);
1031
    oprot.writeDouble(this.totalPrice);
1032
    oprot.writeFieldEnd();
1033
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
1034
    oprot.writeDouble(this.discountedPrice);
1035
    oprot.writeFieldEnd();
1036
    if (this.couponCode != null) {
1037
      oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
1038
      oprot.writeString(this.couponCode);
1039
      oprot.writeFieldEnd();
1040
    }
553 chandransh 1041
    oprot.writeFieldStop();
1042
    oprot.writeStructEnd();
1043
  }
1044
 
1045
  @Override
1046
  public String toString() {
1047
    StringBuilder sb = new StringBuilder("Cart(");
1048
    boolean first = true;
1049
 
1050
    sb.append("id:");
1051
    sb.append(this.id);
1052
    first = false;
1053
    if (!first) sb.append(", ");
1054
    sb.append("lines:");
1055
    if (this.lines == null) {
1056
      sb.append("null");
1057
    } else {
1058
      sb.append(this.lines);
1059
    }
1060
    first = false;
1061
    if (!first) sb.append(", ");
1062
    sb.append("status:");
1063
    if (this.status == null) {
1064
      sb.append("null");
1065
    } else {
1066
      sb.append(this.status);
1067
    }
1068
    first = false;
1069
    if (!first) sb.append(", ");
1070
    sb.append("createdOn:");
1071
    sb.append(this.createdOn);
1072
    first = false;
1073
    if (!first) sb.append(", ");
1074
    sb.append("updatedOn:");
1075
    sb.append(this.updatedOn);
1076
    first = false;
1077
    if (!first) sb.append(", ");
688 chandransh 1078
    sb.append("checkedOutOn:");
1079
    sb.append(this.checkedOutOn);
553 chandransh 1080
    first = false;
1081
    if (!first) sb.append(", ");
1082
    sb.append("addressId:");
1083
    sb.append(this.addressId);
1084
    first = false;
1982 varun.gupt 1085
    if (!first) sb.append(", ");
1086
    sb.append("totalPrice:");
1087
    sb.append(this.totalPrice);
1088
    first = false;
1089
    if (!first) sb.append(", ");
1090
    sb.append("discountedPrice:");
1091
    sb.append(this.discountedPrice);
1092
    first = false;
1093
    if (!first) sb.append(", ");
1094
    sb.append("couponCode:");
1095
    if (this.couponCode == null) {
1096
      sb.append("null");
1097
    } else {
1098
      sb.append(this.couponCode);
1099
    }
1100
    first = false;
553 chandransh 1101
    sb.append(")");
1102
    return sb.toString();
1103
  }
1104
 
3430 rajveer 1105
  public void validate() throws org.apache.thrift.TException {
553 chandransh 1106
    // check for required fields
1107
  }
1108
 
3430 rajveer 1109
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1110
    try {
1111
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1112
    } catch (org.apache.thrift.TException te) {
1113
      throw new java.io.IOException(te);
1114
    }
1115
  }
1116
 
1117
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1118
    try {
1119
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1120
      __isset_bit_vector = new BitSet(1);
1121
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1122
    } catch (org.apache.thrift.TException te) {
1123
      throw new java.io.IOException(te);
1124
    }
1125
  }
1126
 
553 chandransh 1127
}
1128