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 Line implements org.apache.thrift.TBase<Line, Line._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Line");
553 chandransh 25
 
3430 rajveer 26
  private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.DOUBLE, (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 LINE_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("lineStatus", org.apache.thrift.protocol.TType.I32, (short)6);
32
  private static final org.apache.thrift.protocol.TField ESTIMATE_FIELD_DESC = new org.apache.thrift.protocol.TField("estimate", org.apache.thrift.protocol.TType.I32, (short)7);
33
  private static final org.apache.thrift.protocol.TField ACTUAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("actualPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
34
  private static final org.apache.thrift.protocol.TField DISCOUNTED_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("discountedPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
3555 varun.gupt 35
  private static final org.apache.thrift.protocol.TField DISCOUNTS_FIELD_DESC = new org.apache.thrift.protocol.TField("discounts", org.apache.thrift.protocol.TType.LIST, (short)10);
553 chandransh 36
 
3430 rajveer 37
  private long cartId; // required
38
  private long itemId; // required
39
  private double quantity; // required
40
  private long createdOn; // required
41
  private long updatedOn; // required
42
  private LineStatus lineStatus; // required
43
  private int estimate; // required
44
  private double actualPrice; // required
45
  private double discountedPrice; // required
3555 varun.gupt 46
  private List<Discount> discounts; // 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 {
648 chandransh 50
    CART_ID((short)1, "cartId"),
553 chandransh 51
    ITEM_ID((short)2, "itemId"),
52
    QUANTITY((short)3, "quantity"),
53
    CREATED_ON((short)4, "createdOn"),
54
    UPDATED_ON((short)5, "updatedOn"),
55
    /**
56
     * 
57
     * @see LineStatus
58
     */
614 chandransh 59
    LINE_STATUS((short)6, "lineStatus"),
1982 varun.gupt 60
    ESTIMATE((short)7, "estimate"),
61
    ACTUAL_PRICE((short)8, "actualPrice"),
3555 varun.gupt 62
    DISCOUNTED_PRICE((short)9, "discountedPrice"),
63
    DISCOUNTS((short)10, "discounts");
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: // CART_ID
79
          return CART_ID;
80
        case 2: // ITEM_ID
81
          return ITEM_ID;
82
        case 3: // QUANTITY
83
          return QUANTITY;
84
        case 4: // CREATED_ON
85
          return CREATED_ON;
86
        case 5: // UPDATED_ON
87
          return UPDATED_ON;
88
        case 6: // LINE_STATUS
89
          return LINE_STATUS;
90
        case 7: // ESTIMATE
91
          return ESTIMATE;
92
        case 8: // ACTUAL_PRICE
93
          return ACTUAL_PRICE;
94
        case 9: // DISCOUNTED_PRICE
95
          return DISCOUNTED_PRICE;
3555 varun.gupt 96
        case 10: // DISCOUNTS
97
          return DISCOUNTS;
3430 rajveer 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
648 chandransh 138
  private static final int __CARTID_ISSET_ID = 0;
553 chandransh 139
  private static final int __ITEMID_ISSET_ID = 1;
140
  private static final int __QUANTITY_ISSET_ID = 2;
141
  private static final int __CREATEDON_ISSET_ID = 3;
142
  private static final int __UPDATEDON_ISSET_ID = 4;
614 chandransh 143
  private static final int __ESTIMATE_ISSET_ID = 5;
1982 varun.gupt 144
  private static final int __ACTUALPRICE_ISSET_ID = 6;
145
  private static final int __DISCOUNTEDPRICE_ISSET_ID = 7;
146
  private BitSet __isset_bit_vector = new BitSet(8);
553 chandransh 147
 
3430 rajveer 148
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
553 chandransh 149
  static {
3430 rajveer 150
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
151
    tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
153
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
155
    tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
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.LINE_STATUS, new org.apache.thrift.meta_data.FieldMetaData("lineStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
162
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, LineStatus.class)));
163
    tmpMap.put(_Fields.ESTIMATE, new org.apache.thrift.meta_data.FieldMetaData("estimate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
164
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
165
    tmpMap.put(_Fields.ACTUAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("actualPrice", 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)));
3555 varun.gupt 169
    tmpMap.put(_Fields.DISCOUNTS, new org.apache.thrift.meta_data.FieldMetaData("discounts", org.apache.thrift.TFieldRequirementType.DEFAULT, 
170
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
171
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Discount.class))));
3430 rajveer 172
    metaDataMap = Collections.unmodifiableMap(tmpMap);
173
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Line.class, metaDataMap);
553 chandransh 174
  }
175
 
176
  public Line() {
177
  }
178
 
179
  public Line(
648 chandransh 180
    long cartId,
553 chandransh 181
    long itemId,
182
    double quantity,
183
    long createdOn,
184
    long updatedOn,
614 chandransh 185
    LineStatus lineStatus,
1982 varun.gupt 186
    int estimate,
187
    double actualPrice,
3555 varun.gupt 188
    double discountedPrice,
189
    List<Discount> discounts)
553 chandransh 190
  {
191
    this();
648 chandransh 192
    this.cartId = cartId;
193
    setCartIdIsSet(true);
553 chandransh 194
    this.itemId = itemId;
195
    setItemIdIsSet(true);
196
    this.quantity = quantity;
197
    setQuantityIsSet(true);
198
    this.createdOn = createdOn;
199
    setCreatedOnIsSet(true);
200
    this.updatedOn = updatedOn;
201
    setUpdatedOnIsSet(true);
202
    this.lineStatus = lineStatus;
614 chandransh 203
    this.estimate = estimate;
204
    setEstimateIsSet(true);
1982 varun.gupt 205
    this.actualPrice = actualPrice;
206
    setActualPriceIsSet(true);
207
    this.discountedPrice = discountedPrice;
208
    setDiscountedPriceIsSet(true);
3555 varun.gupt 209
    this.discounts = discounts;
553 chandransh 210
  }
211
 
212
  /**
213
   * Performs a deep copy on <i>other</i>.
214
   */
215
  public Line(Line other) {
216
    __isset_bit_vector.clear();
217
    __isset_bit_vector.or(other.__isset_bit_vector);
648 chandransh 218
    this.cartId = other.cartId;
553 chandransh 219
    this.itemId = other.itemId;
220
    this.quantity = other.quantity;
221
    this.createdOn = other.createdOn;
222
    this.updatedOn = other.updatedOn;
223
    if (other.isSetLineStatus()) {
224
      this.lineStatus = other.lineStatus;
225
    }
614 chandransh 226
    this.estimate = other.estimate;
1982 varun.gupt 227
    this.actualPrice = other.actualPrice;
228
    this.discountedPrice = other.discountedPrice;
3555 varun.gupt 229
    if (other.isSetDiscounts()) {
230
      List<Discount> __this__discounts = new ArrayList<Discount>();
231
      for (Discount other_element : other.discounts) {
232
        __this__discounts.add(new Discount(other_element));
233
      }
234
      this.discounts = __this__discounts;
235
    }
553 chandransh 236
  }
237
 
238
  public Line deepCopy() {
239
    return new Line(this);
240
  }
241
 
3430 rajveer 242
  @Override
243
  public void clear() {
244
    setCartIdIsSet(false);
245
    this.cartId = 0;
246
    setItemIdIsSet(false);
247
    this.itemId = 0;
248
    setQuantityIsSet(false);
249
    this.quantity = 0.0;
250
    setCreatedOnIsSet(false);
251
    this.createdOn = 0;
252
    setUpdatedOnIsSet(false);
253
    this.updatedOn = 0;
254
    this.lineStatus = null;
255
    setEstimateIsSet(false);
256
    this.estimate = 0;
257
    setActualPriceIsSet(false);
258
    this.actualPrice = 0.0;
259
    setDiscountedPriceIsSet(false);
260
    this.discountedPrice = 0.0;
3555 varun.gupt 261
    this.discounts = null;
553 chandransh 262
  }
263
 
648 chandransh 264
  public long getCartId() {
265
    return this.cartId;
553 chandransh 266
  }
267
 
3430 rajveer 268
  public void setCartId(long cartId) {
648 chandransh 269
    this.cartId = cartId;
270
    setCartIdIsSet(true);
553 chandransh 271
  }
272
 
648 chandransh 273
  public void unsetCartId() {
274
    __isset_bit_vector.clear(__CARTID_ISSET_ID);
553 chandransh 275
  }
276
 
3430 rajveer 277
  /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
648 chandransh 278
  public boolean isSetCartId() {
279
    return __isset_bit_vector.get(__CARTID_ISSET_ID);
553 chandransh 280
  }
281
 
648 chandransh 282
  public void setCartIdIsSet(boolean value) {
283
    __isset_bit_vector.set(__CARTID_ISSET_ID, value);
553 chandransh 284
  }
285
 
286
  public long getItemId() {
287
    return this.itemId;
288
  }
289
 
3430 rajveer 290
  public void setItemId(long itemId) {
553 chandransh 291
    this.itemId = itemId;
292
    setItemIdIsSet(true);
293
  }
294
 
295
  public void unsetItemId() {
296
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
297
  }
298
 
3430 rajveer 299
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
553 chandransh 300
  public boolean isSetItemId() {
301
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
302
  }
303
 
304
  public void setItemIdIsSet(boolean value) {
305
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
306
  }
307
 
308
  public double getQuantity() {
309
    return this.quantity;
310
  }
311
 
3430 rajveer 312
  public void setQuantity(double quantity) {
553 chandransh 313
    this.quantity = quantity;
314
    setQuantityIsSet(true);
315
  }
316
 
317
  public void unsetQuantity() {
318
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
319
  }
320
 
3430 rajveer 321
  /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
553 chandransh 322
  public boolean isSetQuantity() {
323
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
324
  }
325
 
326
  public void setQuantityIsSet(boolean value) {
327
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
328
  }
329
 
330
  public long getCreatedOn() {
331
    return this.createdOn;
332
  }
333
 
3430 rajveer 334
  public void setCreatedOn(long createdOn) {
553 chandransh 335
    this.createdOn = createdOn;
336
    setCreatedOnIsSet(true);
337
  }
338
 
339
  public void unsetCreatedOn() {
340
    __isset_bit_vector.clear(__CREATEDON_ISSET_ID);
341
  }
342
 
3430 rajveer 343
  /** Returns true if field createdOn is set (has been assigned a value) and false otherwise */
553 chandransh 344
  public boolean isSetCreatedOn() {
345
    return __isset_bit_vector.get(__CREATEDON_ISSET_ID);
346
  }
347
 
348
  public void setCreatedOnIsSet(boolean value) {
349
    __isset_bit_vector.set(__CREATEDON_ISSET_ID, value);
350
  }
351
 
352
  public long getUpdatedOn() {
353
    return this.updatedOn;
354
  }
355
 
3430 rajveer 356
  public void setUpdatedOn(long updatedOn) {
553 chandransh 357
    this.updatedOn = updatedOn;
358
    setUpdatedOnIsSet(true);
359
  }
360
 
361
  public void unsetUpdatedOn() {
362
    __isset_bit_vector.clear(__UPDATEDON_ISSET_ID);
363
  }
364
 
3430 rajveer 365
  /** Returns true if field updatedOn is set (has been assigned a value) and false otherwise */
553 chandransh 366
  public boolean isSetUpdatedOn() {
367
    return __isset_bit_vector.get(__UPDATEDON_ISSET_ID);
368
  }
369
 
370
  public void setUpdatedOnIsSet(boolean value) {
371
    __isset_bit_vector.set(__UPDATEDON_ISSET_ID, value);
372
  }
373
 
374
  /**
375
   * 
376
   * @see LineStatus
377
   */
378
  public LineStatus getLineStatus() {
379
    return this.lineStatus;
380
  }
381
 
382
  /**
383
   * 
384
   * @see LineStatus
385
   */
3430 rajveer 386
  public void setLineStatus(LineStatus lineStatus) {
553 chandransh 387
    this.lineStatus = lineStatus;
388
  }
389
 
390
  public void unsetLineStatus() {
391
    this.lineStatus = null;
392
  }
393
 
3430 rajveer 394
  /** Returns true if field lineStatus is set (has been assigned a value) and false otherwise */
553 chandransh 395
  public boolean isSetLineStatus() {
396
    return this.lineStatus != null;
397
  }
398
 
399
  public void setLineStatusIsSet(boolean value) {
400
    if (!value) {
401
      this.lineStatus = null;
402
    }
403
  }
404
 
614 chandransh 405
  public int getEstimate() {
406
    return this.estimate;
407
  }
408
 
3430 rajveer 409
  public void setEstimate(int estimate) {
614 chandransh 410
    this.estimate = estimate;
411
    setEstimateIsSet(true);
412
  }
413
 
414
  public void unsetEstimate() {
415
    __isset_bit_vector.clear(__ESTIMATE_ISSET_ID);
416
  }
417
 
3430 rajveer 418
  /** Returns true if field estimate is set (has been assigned a value) and false otherwise */
614 chandransh 419
  public boolean isSetEstimate() {
420
    return __isset_bit_vector.get(__ESTIMATE_ISSET_ID);
421
  }
422
 
423
  public void setEstimateIsSet(boolean value) {
424
    __isset_bit_vector.set(__ESTIMATE_ISSET_ID, value);
425
  }
426
 
1982 varun.gupt 427
  public double getActualPrice() {
428
    return this.actualPrice;
429
  }
430
 
3430 rajveer 431
  public void setActualPrice(double actualPrice) {
1982 varun.gupt 432
    this.actualPrice = actualPrice;
433
    setActualPriceIsSet(true);
434
  }
435
 
436
  public void unsetActualPrice() {
437
    __isset_bit_vector.clear(__ACTUALPRICE_ISSET_ID);
438
  }
439
 
3430 rajveer 440
  /** Returns true if field actualPrice is set (has been assigned a value) and false otherwise */
1982 varun.gupt 441
  public boolean isSetActualPrice() {
442
    return __isset_bit_vector.get(__ACTUALPRICE_ISSET_ID);
443
  }
444
 
445
  public void setActualPriceIsSet(boolean value) {
446
    __isset_bit_vector.set(__ACTUALPRICE_ISSET_ID, value);
447
  }
448
 
449
  public double getDiscountedPrice() {
450
    return this.discountedPrice;
451
  }
452
 
3430 rajveer 453
  public void setDiscountedPrice(double discountedPrice) {
1982 varun.gupt 454
    this.discountedPrice = discountedPrice;
455
    setDiscountedPriceIsSet(true);
456
  }
457
 
458
  public void unsetDiscountedPrice() {
459
    __isset_bit_vector.clear(__DISCOUNTEDPRICE_ISSET_ID);
460
  }
461
 
3430 rajveer 462
  /** Returns true if field discountedPrice is set (has been assigned a value) and false otherwise */
1982 varun.gupt 463
  public boolean isSetDiscountedPrice() {
464
    return __isset_bit_vector.get(__DISCOUNTEDPRICE_ISSET_ID);
465
  }
466
 
467
  public void setDiscountedPriceIsSet(boolean value) {
468
    __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
469
  }
470
 
3555 varun.gupt 471
  public int getDiscountsSize() {
472
    return (this.discounts == null) ? 0 : this.discounts.size();
473
  }
474
 
475
  public java.util.Iterator<Discount> getDiscountsIterator() {
476
    return (this.discounts == null) ? null : this.discounts.iterator();
477
  }
478
 
479
  public void addToDiscounts(Discount elem) {
480
    if (this.discounts == null) {
481
      this.discounts = new ArrayList<Discount>();
482
    }
483
    this.discounts.add(elem);
484
  }
485
 
486
  public List<Discount> getDiscounts() {
487
    return this.discounts;
488
  }
489
 
490
  public void setDiscounts(List<Discount> discounts) {
491
    this.discounts = discounts;
492
  }
493
 
494
  public void unsetDiscounts() {
495
    this.discounts = null;
496
  }
497
 
498
  /** Returns true if field discounts is set (has been assigned a value) and false otherwise */
499
  public boolean isSetDiscounts() {
500
    return this.discounts != null;
501
  }
502
 
503
  public void setDiscountsIsSet(boolean value) {
504
    if (!value) {
505
      this.discounts = null;
506
    }
507
  }
508
 
553 chandransh 509
  public void setFieldValue(_Fields field, Object value) {
510
    switch (field) {
648 chandransh 511
    case CART_ID:
553 chandransh 512
      if (value == null) {
648 chandransh 513
        unsetCartId();
553 chandransh 514
      } else {
648 chandransh 515
        setCartId((Long)value);
553 chandransh 516
      }
517
      break;
518
 
519
    case ITEM_ID:
520
      if (value == null) {
521
        unsetItemId();
522
      } else {
523
        setItemId((Long)value);
524
      }
525
      break;
526
 
527
    case QUANTITY:
528
      if (value == null) {
529
        unsetQuantity();
530
      } else {
531
        setQuantity((Double)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
 
551
    case LINE_STATUS:
552
      if (value == null) {
553
        unsetLineStatus();
554
      } else {
555
        setLineStatus((LineStatus)value);
556
      }
557
      break;
558
 
614 chandransh 559
    case ESTIMATE:
560
      if (value == null) {
561
        unsetEstimate();
562
      } else {
563
        setEstimate((Integer)value);
564
      }
565
      break;
566
 
1982 varun.gupt 567
    case ACTUAL_PRICE:
568
      if (value == null) {
569
        unsetActualPrice();
570
      } else {
571
        setActualPrice((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
 
3555 varun.gupt 583
    case DISCOUNTS:
584
      if (value == null) {
585
        unsetDiscounts();
586
      } else {
587
        setDiscounts((List<Discount>)value);
588
      }
589
      break;
590
 
553 chandransh 591
    }
592
  }
593
 
594
  public Object getFieldValue(_Fields field) {
595
    switch (field) {
648 chandransh 596
    case CART_ID:
3430 rajveer 597
      return Long.valueOf(getCartId());
553 chandransh 598
 
599
    case ITEM_ID:
3430 rajveer 600
      return Long.valueOf(getItemId());
553 chandransh 601
 
602
    case QUANTITY:
3430 rajveer 603
      return Double.valueOf(getQuantity());
553 chandransh 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
 
611
    case LINE_STATUS:
612
      return getLineStatus();
613
 
614 chandransh 614
    case ESTIMATE:
3430 rajveer 615
      return Integer.valueOf(getEstimate());
614 chandransh 616
 
1982 varun.gupt 617
    case ACTUAL_PRICE:
3430 rajveer 618
      return Double.valueOf(getActualPrice());
1982 varun.gupt 619
 
620
    case DISCOUNTED_PRICE:
3430 rajveer 621
      return Double.valueOf(getDiscountedPrice());
1982 varun.gupt 622
 
3555 varun.gupt 623
    case DISCOUNTS:
624
      return getDiscounts();
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) {
648 chandransh 637
    case CART_ID:
638
      return isSetCartId();
553 chandransh 639
    case ITEM_ID:
640
      return isSetItemId();
641
    case QUANTITY:
642
      return isSetQuantity();
643
    case CREATED_ON:
644
      return isSetCreatedOn();
645
    case UPDATED_ON:
646
      return isSetUpdatedOn();
647
    case LINE_STATUS:
648
      return isSetLineStatus();
614 chandransh 649
    case ESTIMATE:
650
      return isSetEstimate();
1982 varun.gupt 651
    case ACTUAL_PRICE:
652
      return isSetActualPrice();
653
    case DISCOUNTED_PRICE:
654
      return isSetDiscountedPrice();
3555 varun.gupt 655
    case DISCOUNTS:
656
      return isSetDiscounts();
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 Line)
666
      return this.equals((Line)that);
667
    return false;
668
  }
669
 
670
  public boolean equals(Line that) {
671
    if (that == null)
672
      return false;
673
 
648 chandransh 674
    boolean this_present_cartId = true;
675
    boolean that_present_cartId = true;
676
    if (this_present_cartId || that_present_cartId) {
677
      if (!(this_present_cartId && that_present_cartId))
553 chandransh 678
        return false;
648 chandransh 679
      if (this.cartId != that.cartId)
553 chandransh 680
        return false;
681
    }
682
 
683
    boolean this_present_itemId = true;
684
    boolean that_present_itemId = true;
685
    if (this_present_itemId || that_present_itemId) {
686
      if (!(this_present_itemId && that_present_itemId))
687
        return false;
688
      if (this.itemId != that.itemId)
689
        return false;
690
    }
691
 
692
    boolean this_present_quantity = true;
693
    boolean that_present_quantity = true;
694
    if (this_present_quantity || that_present_quantity) {
695
      if (!(this_present_quantity && that_present_quantity))
696
        return false;
697
      if (this.quantity != that.quantity)
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
 
719
    boolean this_present_lineStatus = true && this.isSetLineStatus();
720
    boolean that_present_lineStatus = true && that.isSetLineStatus();
721
    if (this_present_lineStatus || that_present_lineStatus) {
722
      if (!(this_present_lineStatus && that_present_lineStatus))
723
        return false;
724
      if (!this.lineStatus.equals(that.lineStatus))
725
        return false;
726
    }
727
 
614 chandransh 728
    boolean this_present_estimate = true;
729
    boolean that_present_estimate = true;
730
    if (this_present_estimate || that_present_estimate) {
731
      if (!(this_present_estimate && that_present_estimate))
732
        return false;
733
      if (this.estimate != that.estimate)
734
        return false;
735
    }
736
 
1982 varun.gupt 737
    boolean this_present_actualPrice = true;
738
    boolean that_present_actualPrice = true;
739
    if (this_present_actualPrice || that_present_actualPrice) {
740
      if (!(this_present_actualPrice && that_present_actualPrice))
741
        return false;
742
      if (this.actualPrice != that.actualPrice)
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
 
3555 varun.gupt 755
    boolean this_present_discounts = true && this.isSetDiscounts();
756
    boolean that_present_discounts = true && that.isSetDiscounts();
757
    if (this_present_discounts || that_present_discounts) {
758
      if (!(this_present_discounts && that_present_discounts))
759
        return false;
760
      if (!this.discounts.equals(that.discounts))
761
        return false;
762
    }
763
 
553 chandransh 764
    return true;
765
  }
766
 
767
  @Override
768
  public int hashCode() {
769
    return 0;
770
  }
771
 
772
  public int compareTo(Line other) {
773
    if (!getClass().equals(other.getClass())) {
774
      return getClass().getName().compareTo(other.getClass().getName());
775
    }
776
 
777
    int lastComparison = 0;
778
    Line typedOther = (Line)other;
779
 
3430 rajveer 780
    lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
553 chandransh 781
    if (lastComparison != 0) {
782
      return lastComparison;
783
    }
3430 rajveer 784
    if (isSetCartId()) {
785
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
786
      if (lastComparison != 0) {
787
        return lastComparison;
788
      }
553 chandransh 789
    }
3430 rajveer 790
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
553 chandransh 791
    if (lastComparison != 0) {
792
      return lastComparison;
793
    }
3430 rajveer 794
    if (isSetItemId()) {
795
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
796
      if (lastComparison != 0) {
797
        return lastComparison;
798
      }
553 chandransh 799
    }
3430 rajveer 800
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
553 chandransh 801
    if (lastComparison != 0) {
802
      return lastComparison;
803
    }
3430 rajveer 804
    if (isSetQuantity()) {
805
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
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(isSetLineStatus()).compareTo(typedOther.isSetLineStatus());
553 chandransh 831
    if (lastComparison != 0) {
832
      return lastComparison;
833
    }
3430 rajveer 834
    if (isSetLineStatus()) {
835
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lineStatus, typedOther.lineStatus);
836
      if (lastComparison != 0) {
837
        return lastComparison;
838
      }
553 chandransh 839
    }
3430 rajveer 840
    lastComparison = Boolean.valueOf(isSetEstimate()).compareTo(typedOther.isSetEstimate());
614 chandransh 841
    if (lastComparison != 0) {
842
      return lastComparison;
843
    }
3430 rajveer 844
    if (isSetEstimate()) {
845
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.estimate, typedOther.estimate);
846
      if (lastComparison != 0) {
847
        return lastComparison;
848
      }
614 chandransh 849
    }
3430 rajveer 850
    lastComparison = Boolean.valueOf(isSetActualPrice()).compareTo(typedOther.isSetActualPrice());
1982 varun.gupt 851
    if (lastComparison != 0) {
852
      return lastComparison;
853
    }
3430 rajveer 854
    if (isSetActualPrice()) {
855
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.actualPrice, typedOther.actualPrice);
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
    }
3555 varun.gupt 870
    lastComparison = Boolean.valueOf(isSetDiscounts()).compareTo(typedOther.isSetDiscounts());
871
    if (lastComparison != 0) {
872
      return lastComparison;
873
    }
874
    if (isSetDiscounts()) {
875
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.discounts, typedOther.discounts);
876
      if (lastComparison != 0) {
877
        return lastComparison;
878
      }
879
    }
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: // CART_ID
898
          if (field.type == org.apache.thrift.protocol.TType.I64) {
899
            this.cartId = iprot.readI64();
900
            setCartIdIsSet(true);
901
          } else { 
902
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
903
          }
904
          break;
905
        case 2: // ITEM_ID
906
          if (field.type == org.apache.thrift.protocol.TType.I64) {
907
            this.itemId = iprot.readI64();
908
            setItemIdIsSet(true);
909
          } else { 
910
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
911
          }
912
          break;
913
        case 3: // QUANTITY
914
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
915
            this.quantity = iprot.readDouble();
916
            setQuantityIsSet(true);
917
          } else { 
918
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
919
          }
920
          break;
921
        case 4: // CREATED_ON
922
          if (field.type == org.apache.thrift.protocol.TType.I64) {
923
            this.createdOn = iprot.readI64();
924
            setCreatedOnIsSet(true);
925
          } else { 
926
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
927
          }
928
          break;
929
        case 5: // UPDATED_ON
930
          if (field.type == org.apache.thrift.protocol.TType.I64) {
931
            this.updatedOn = iprot.readI64();
932
            setUpdatedOnIsSet(true);
933
          } else { 
934
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
935
          }
936
          break;
937
        case 6: // LINE_STATUS
938
          if (field.type == org.apache.thrift.protocol.TType.I32) {
939
            this.lineStatus = LineStatus.findByValue(iprot.readI32());
940
          } else { 
941
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
942
          }
943
          break;
944
        case 7: // ESTIMATE
945
          if (field.type == org.apache.thrift.protocol.TType.I32) {
946
            this.estimate = iprot.readI32();
947
            setEstimateIsSet(true);
948
          } else { 
949
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
950
          }
951
          break;
952
        case 8: // ACTUAL_PRICE
953
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
954
            this.actualPrice = iprot.readDouble();
955
            setActualPriceIsSet(true);
956
          } else { 
957
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
958
          }
959
          break;
960
        case 9: // DISCOUNTED_PRICE
961
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
962
            this.discountedPrice = iprot.readDouble();
963
            setDiscountedPriceIsSet(true);
964
          } else { 
965
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
966
          }
967
          break;
3555 varun.gupt 968
        case 10: // DISCOUNTS
969
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
970
            {
971
              org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
972
              this.discounts = new ArrayList<Discount>(_list8.size);
973
              for (int _i9 = 0; _i9 < _list8.size; ++_i9)
974
              {
975
                Discount _elem10; // required
976
                _elem10 = new Discount();
977
                _elem10.read(iprot);
978
                this.discounts.add(_elem10);
979
              }
980
              iprot.readListEnd();
981
            }
982
          } else { 
983
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
984
          }
985
          break;
3430 rajveer 986
        default:
987
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
553 chandransh 988
      }
3430 rajveer 989
      iprot.readFieldEnd();
553 chandransh 990
    }
991
    iprot.readStructEnd();
992
    validate();
993
  }
994
 
3430 rajveer 995
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
553 chandransh 996
    validate();
997
 
998
    oprot.writeStructBegin(STRUCT_DESC);
648 chandransh 999
    oprot.writeFieldBegin(CART_ID_FIELD_DESC);
1000
    oprot.writeI64(this.cartId);
553 chandransh 1001
    oprot.writeFieldEnd();
1002
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
1003
    oprot.writeI64(this.itemId);
1004
    oprot.writeFieldEnd();
1005
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
1006
    oprot.writeDouble(this.quantity);
1007
    oprot.writeFieldEnd();
1008
    oprot.writeFieldBegin(CREATED_ON_FIELD_DESC);
1009
    oprot.writeI64(this.createdOn);
1010
    oprot.writeFieldEnd();
1011
    oprot.writeFieldBegin(UPDATED_ON_FIELD_DESC);
1012
    oprot.writeI64(this.updatedOn);
1013
    oprot.writeFieldEnd();
1014
    if (this.lineStatus != null) {
1015
      oprot.writeFieldBegin(LINE_STATUS_FIELD_DESC);
1016
      oprot.writeI32(this.lineStatus.getValue());
1017
      oprot.writeFieldEnd();
1018
    }
614 chandransh 1019
    oprot.writeFieldBegin(ESTIMATE_FIELD_DESC);
1020
    oprot.writeI32(this.estimate);
1021
    oprot.writeFieldEnd();
1982 varun.gupt 1022
    oprot.writeFieldBegin(ACTUAL_PRICE_FIELD_DESC);
1023
    oprot.writeDouble(this.actualPrice);
1024
    oprot.writeFieldEnd();
1025
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
1026
    oprot.writeDouble(this.discountedPrice);
1027
    oprot.writeFieldEnd();
3555 varun.gupt 1028
    if (this.discounts != null) {
1029
      oprot.writeFieldBegin(DISCOUNTS_FIELD_DESC);
1030
      {
1031
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.discounts.size()));
1032
        for (Discount _iter11 : this.discounts)
1033
        {
1034
          _iter11.write(oprot);
1035
        }
1036
        oprot.writeListEnd();
1037
      }
1038
      oprot.writeFieldEnd();
1039
    }
553 chandransh 1040
    oprot.writeFieldStop();
1041
    oprot.writeStructEnd();
1042
  }
1043
 
1044
  @Override
1045
  public String toString() {
1046
    StringBuilder sb = new StringBuilder("Line(");
1047
    boolean first = true;
1048
 
648 chandransh 1049
    sb.append("cartId:");
1050
    sb.append(this.cartId);
553 chandransh 1051
    first = false;
1052
    if (!first) sb.append(", ");
1053
    sb.append("itemId:");
1054
    sb.append(this.itemId);
1055
    first = false;
1056
    if (!first) sb.append(", ");
1057
    sb.append("quantity:");
1058
    sb.append(this.quantity);
1059
    first = false;
1060
    if (!first) sb.append(", ");
1061
    sb.append("createdOn:");
1062
    sb.append(this.createdOn);
1063
    first = false;
1064
    if (!first) sb.append(", ");
1065
    sb.append("updatedOn:");
1066
    sb.append(this.updatedOn);
1067
    first = false;
1068
    if (!first) sb.append(", ");
1069
    sb.append("lineStatus:");
1070
    if (this.lineStatus == null) {
1071
      sb.append("null");
1072
    } else {
1073
      sb.append(this.lineStatus);
1074
    }
1075
    first = false;
614 chandransh 1076
    if (!first) sb.append(", ");
1077
    sb.append("estimate:");
1078
    sb.append(this.estimate);
1079
    first = false;
1982 varun.gupt 1080
    if (!first) sb.append(", ");
1081
    sb.append("actualPrice:");
1082
    sb.append(this.actualPrice);
1083
    first = false;
1084
    if (!first) sb.append(", ");
1085
    sb.append("discountedPrice:");
1086
    sb.append(this.discountedPrice);
1087
    first = false;
3555 varun.gupt 1088
    if (!first) sb.append(", ");
1089
    sb.append("discounts:");
1090
    if (this.discounts == null) {
1091
      sb.append("null");
1092
    } else {
1093
      sb.append(this.discounts);
1094
    }
1095
    first = false;
553 chandransh 1096
    sb.append(")");
1097
    return sb.toString();
1098
  }
1099
 
3430 rajveer 1100
  public void validate() throws org.apache.thrift.TException {
553 chandransh 1101
    // check for required fields
1102
  }
1103
 
3430 rajveer 1104
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1105
    try {
1106
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1107
    } catch (org.apache.thrift.TException te) {
1108
      throw new java.io.IOException(te);
1109
    }
1110
  }
1111
 
1112
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1113
    try {
1114
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1115
      __isset_bit_vector = new BitSet(1);
1116
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1117
    } catch (org.apache.thrift.TException te) {
1118
      throw new java.io.IOException(te);
1119
    }
1120
  }
1121
 
553 chandransh 1122
}
1123