Subversion Repositories SmartDukaan

Rev

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