Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
553 chandransh 1
/**
2
 * Autogenerated by Thrift
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;
18
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class Line implements TBase<Line._Fields>, java.io.Serializable, Cloneable, Comparable<Line> {
27
  private static final TStruct STRUCT_DESC = new TStruct("Line");
28
 
648 chandransh 29
  private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
553 chandransh 30
  private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);
31
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)3);
32
  private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)4);
33
  private static final TField UPDATED_ON_FIELD_DESC = new TField("updatedOn", TType.I64, (short)5);
34
  private static final TField LINE_STATUS_FIELD_DESC = new TField("lineStatus", TType.I32, (short)6);
614 chandransh 35
  private static final TField ESTIMATE_FIELD_DESC = new TField("estimate", TType.I32, (short)7);
1982 varun.gupt 36
  private static final TField ACTUAL_PRICE_FIELD_DESC = new TField("actualPrice", TType.DOUBLE, (short)8);
37
  private static final TField DISCOUNTED_PRICE_FIELD_DESC = new TField("discountedPrice", TType.DOUBLE, (short)9);
553 chandransh 38
 
648 chandransh 39
  private long cartId;
553 chandransh 40
  private long itemId;
41
  private double quantity;
42
  private long createdOn;
43
  private long updatedOn;
44
  private LineStatus lineStatus;
614 chandransh 45
  private int estimate;
1982 varun.gupt 46
  private double actualPrice;
47
  private double discountedPrice;
553 chandransh 48
 
49
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
50
  public enum _Fields implements TFieldIdEnum {
648 chandransh 51
    CART_ID((short)1, "cartId"),
553 chandransh 52
    ITEM_ID((short)2, "itemId"),
53
    QUANTITY((short)3, "quantity"),
54
    CREATED_ON((short)4, "createdOn"),
55
    UPDATED_ON((short)5, "updatedOn"),
56
    /**
57
     * 
58
     * @see LineStatus
59
     */
614 chandransh 60
    LINE_STATUS((short)6, "lineStatus"),
1982 varun.gupt 61
    ESTIMATE((short)7, "estimate"),
62
    ACTUAL_PRICE((short)8, "actualPrice"),
63
    DISCOUNTED_PRICE((short)9, "discountedPrice");
553 chandransh 64
 
65
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
66
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
67
 
68
    static {
69
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
70
        byId.put((int)field._thriftId, field);
71
        byName.put(field.getFieldName(), field);
72
      }
73
    }
74
 
75
    /**
76
     * Find the _Fields constant that matches fieldId, or null if its not found.
77
     */
78
    public static _Fields findByThriftId(int fieldId) {
79
      return byId.get(fieldId);
80
    }
81
 
82
    /**
83
     * Find the _Fields constant that matches fieldId, throwing an exception
84
     * if it is not found.
85
     */
86
    public static _Fields findByThriftIdOrThrow(int fieldId) {
87
      _Fields fields = findByThriftId(fieldId);
88
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
89
      return fields;
90
    }
91
 
92
    /**
93
     * Find the _Fields constant that matches name, or null if its not found.
94
     */
95
    public static _Fields findByName(String name) {
96
      return byName.get(name);
97
    }
98
 
99
    private final short _thriftId;
100
    private final String _fieldName;
101
 
102
    _Fields(short thriftId, String fieldName) {
103
      _thriftId = thriftId;
104
      _fieldName = fieldName;
105
    }
106
 
107
    public short getThriftFieldId() {
108
      return _thriftId;
109
    }
110
 
111
    public String getFieldName() {
112
      return _fieldName;
113
    }
114
  }
115
 
116
  // isset id assignments
648 chandransh 117
  private static final int __CARTID_ISSET_ID = 0;
553 chandransh 118
  private static final int __ITEMID_ISSET_ID = 1;
119
  private static final int __QUANTITY_ISSET_ID = 2;
120
  private static final int __CREATEDON_ISSET_ID = 3;
121
  private static final int __UPDATEDON_ISSET_ID = 4;
614 chandransh 122
  private static final int __ESTIMATE_ISSET_ID = 5;
1982 varun.gupt 123
  private static final int __ACTUALPRICE_ISSET_ID = 6;
124
  private static final int __DISCOUNTEDPRICE_ISSET_ID = 7;
125
  private BitSet __isset_bit_vector = new BitSet(8);
553 chandransh 126
 
127
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
648 chandransh 128
    put(_Fields.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
553 chandransh 129
        new FieldValueMetaData(TType.I64)));
130
    put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
131
        new FieldValueMetaData(TType.I64)));
132
    put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.DEFAULT, 
133
        new FieldValueMetaData(TType.DOUBLE)));
134
    put(_Fields.CREATED_ON, new FieldMetaData("createdOn", TFieldRequirementType.DEFAULT, 
135
        new FieldValueMetaData(TType.I64)));
136
    put(_Fields.UPDATED_ON, new FieldMetaData("updatedOn", TFieldRequirementType.DEFAULT, 
137
        new FieldValueMetaData(TType.I64)));
138
    put(_Fields.LINE_STATUS, new FieldMetaData("lineStatus", TFieldRequirementType.DEFAULT, 
139
        new EnumMetaData(TType.ENUM, LineStatus.class)));
614 chandransh 140
    put(_Fields.ESTIMATE, new FieldMetaData("estimate", TFieldRequirementType.DEFAULT, 
141
        new FieldValueMetaData(TType.I32)));
1982 varun.gupt 142
    put(_Fields.ACTUAL_PRICE, new FieldMetaData("actualPrice", TFieldRequirementType.DEFAULT, 
143
        new FieldValueMetaData(TType.DOUBLE)));
144
    put(_Fields.DISCOUNTED_PRICE, new FieldMetaData("discountedPrice", TFieldRequirementType.DEFAULT, 
145
        new FieldValueMetaData(TType.DOUBLE)));
553 chandransh 146
  }});
147
 
148
  static {
149
    FieldMetaData.addStructMetaDataMap(Line.class, metaDataMap);
150
  }
151
 
152
  public Line() {
153
  }
154
 
155
  public Line(
648 chandransh 156
    long cartId,
553 chandransh 157
    long itemId,
158
    double quantity,
159
    long createdOn,
160
    long updatedOn,
614 chandransh 161
    LineStatus lineStatus,
1982 varun.gupt 162
    int estimate,
163
    double actualPrice,
164
    double discountedPrice)
553 chandransh 165
  {
166
    this();
648 chandransh 167
    this.cartId = cartId;
168
    setCartIdIsSet(true);
553 chandransh 169
    this.itemId = itemId;
170
    setItemIdIsSet(true);
171
    this.quantity = quantity;
172
    setQuantityIsSet(true);
173
    this.createdOn = createdOn;
174
    setCreatedOnIsSet(true);
175
    this.updatedOn = updatedOn;
176
    setUpdatedOnIsSet(true);
177
    this.lineStatus = lineStatus;
614 chandransh 178
    this.estimate = estimate;
179
    setEstimateIsSet(true);
1982 varun.gupt 180
    this.actualPrice = actualPrice;
181
    setActualPriceIsSet(true);
182
    this.discountedPrice = discountedPrice;
183
    setDiscountedPriceIsSet(true);
553 chandransh 184
  }
185
 
186
  /**
187
   * Performs a deep copy on <i>other</i>.
188
   */
189
  public Line(Line other) {
190
    __isset_bit_vector.clear();
191
    __isset_bit_vector.or(other.__isset_bit_vector);
648 chandransh 192
    this.cartId = other.cartId;
553 chandransh 193
    this.itemId = other.itemId;
194
    this.quantity = other.quantity;
195
    this.createdOn = other.createdOn;
196
    this.updatedOn = other.updatedOn;
197
    if (other.isSetLineStatus()) {
198
      this.lineStatus = other.lineStatus;
199
    }
614 chandransh 200
    this.estimate = other.estimate;
1982 varun.gupt 201
    this.actualPrice = other.actualPrice;
202
    this.discountedPrice = other.discountedPrice;
553 chandransh 203
  }
204
 
205
  public Line deepCopy() {
206
    return new Line(this);
207
  }
208
 
209
  @Deprecated
210
  public Line clone() {
211
    return new Line(this);
212
  }
213
 
648 chandransh 214
  public long getCartId() {
215
    return this.cartId;
553 chandransh 216
  }
217
 
648 chandransh 218
  public Line setCartId(long cartId) {
219
    this.cartId = cartId;
220
    setCartIdIsSet(true);
553 chandransh 221
    return this;
222
  }
223
 
648 chandransh 224
  public void unsetCartId() {
225
    __isset_bit_vector.clear(__CARTID_ISSET_ID);
553 chandransh 226
  }
227
 
648 chandransh 228
  /** Returns true if field cartId is set (has been asigned a value) and false otherwise */
229
  public boolean isSetCartId() {
230
    return __isset_bit_vector.get(__CARTID_ISSET_ID);
553 chandransh 231
  }
232
 
648 chandransh 233
  public void setCartIdIsSet(boolean value) {
234
    __isset_bit_vector.set(__CARTID_ISSET_ID, value);
553 chandransh 235
  }
236
 
237
  public long getItemId() {
238
    return this.itemId;
239
  }
240
 
241
  public Line setItemId(long itemId) {
242
    this.itemId = itemId;
243
    setItemIdIsSet(true);
244
    return this;
245
  }
246
 
247
  public void unsetItemId() {
248
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
249
  }
250
 
251
  /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
252
  public boolean isSetItemId() {
253
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
254
  }
255
 
256
  public void setItemIdIsSet(boolean value) {
257
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
258
  }
259
 
260
  public double getQuantity() {
261
    return this.quantity;
262
  }
263
 
264
  public Line setQuantity(double quantity) {
265
    this.quantity = quantity;
266
    setQuantityIsSet(true);
267
    return this;
268
  }
269
 
270
  public void unsetQuantity() {
271
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
272
  }
273
 
274
  /** Returns true if field quantity is set (has been asigned a value) and false otherwise */
275
  public boolean isSetQuantity() {
276
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
277
  }
278
 
279
  public void setQuantityIsSet(boolean value) {
280
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
281
  }
282
 
283
  public long getCreatedOn() {
284
    return this.createdOn;
285
  }
286
 
287
  public Line setCreatedOn(long createdOn) {
288
    this.createdOn = createdOn;
289
    setCreatedOnIsSet(true);
290
    return this;
291
  }
292
 
293
  public void unsetCreatedOn() {
294
    __isset_bit_vector.clear(__CREATEDON_ISSET_ID);
295
  }
296
 
297
  /** Returns true if field createdOn is set (has been asigned a value) and false otherwise */
298
  public boolean isSetCreatedOn() {
299
    return __isset_bit_vector.get(__CREATEDON_ISSET_ID);
300
  }
301
 
302
  public void setCreatedOnIsSet(boolean value) {
303
    __isset_bit_vector.set(__CREATEDON_ISSET_ID, value);
304
  }
305
 
306
  public long getUpdatedOn() {
307
    return this.updatedOn;
308
  }
309
 
310
  public Line setUpdatedOn(long updatedOn) {
311
    this.updatedOn = updatedOn;
312
    setUpdatedOnIsSet(true);
313
    return this;
314
  }
315
 
316
  public void unsetUpdatedOn() {
317
    __isset_bit_vector.clear(__UPDATEDON_ISSET_ID);
318
  }
319
 
320
  /** Returns true if field updatedOn is set (has been asigned a value) and false otherwise */
321
  public boolean isSetUpdatedOn() {
322
    return __isset_bit_vector.get(__UPDATEDON_ISSET_ID);
323
  }
324
 
325
  public void setUpdatedOnIsSet(boolean value) {
326
    __isset_bit_vector.set(__UPDATEDON_ISSET_ID, value);
327
  }
328
 
329
  /**
330
   * 
331
   * @see LineStatus
332
   */
333
  public LineStatus getLineStatus() {
334
    return this.lineStatus;
335
  }
336
 
337
  /**
338
   * 
339
   * @see LineStatus
340
   */
341
  public Line setLineStatus(LineStatus lineStatus) {
342
    this.lineStatus = lineStatus;
343
    return this;
344
  }
345
 
346
  public void unsetLineStatus() {
347
    this.lineStatus = null;
348
  }
349
 
350
  /** Returns true if field lineStatus is set (has been asigned a value) and false otherwise */
351
  public boolean isSetLineStatus() {
352
    return this.lineStatus != null;
353
  }
354
 
355
  public void setLineStatusIsSet(boolean value) {
356
    if (!value) {
357
      this.lineStatus = null;
358
    }
359
  }
360
 
614 chandransh 361
  public int getEstimate() {
362
    return this.estimate;
363
  }
364
 
365
  public Line setEstimate(int estimate) {
366
    this.estimate = estimate;
367
    setEstimateIsSet(true);
368
    return this;
369
  }
370
 
371
  public void unsetEstimate() {
372
    __isset_bit_vector.clear(__ESTIMATE_ISSET_ID);
373
  }
374
 
375
  /** Returns true if field estimate is set (has been asigned a value) and false otherwise */
376
  public boolean isSetEstimate() {
377
    return __isset_bit_vector.get(__ESTIMATE_ISSET_ID);
378
  }
379
 
380
  public void setEstimateIsSet(boolean value) {
381
    __isset_bit_vector.set(__ESTIMATE_ISSET_ID, value);
382
  }
383
 
1982 varun.gupt 384
  public double getActualPrice() {
385
    return this.actualPrice;
386
  }
387
 
388
  public Line setActualPrice(double actualPrice) {
389
    this.actualPrice = actualPrice;
390
    setActualPriceIsSet(true);
391
    return this;
392
  }
393
 
394
  public void unsetActualPrice() {
395
    __isset_bit_vector.clear(__ACTUALPRICE_ISSET_ID);
396
  }
397
 
398
  /** Returns true if field actualPrice is set (has been asigned a value) and false otherwise */
399
  public boolean isSetActualPrice() {
400
    return __isset_bit_vector.get(__ACTUALPRICE_ISSET_ID);
401
  }
402
 
403
  public void setActualPriceIsSet(boolean value) {
404
    __isset_bit_vector.set(__ACTUALPRICE_ISSET_ID, value);
405
  }
406
 
407
  public double getDiscountedPrice() {
408
    return this.discountedPrice;
409
  }
410
 
411
  public Line setDiscountedPrice(double discountedPrice) {
412
    this.discountedPrice = discountedPrice;
413
    setDiscountedPriceIsSet(true);
414
    return this;
415
  }
416
 
417
  public void unsetDiscountedPrice() {
418
    __isset_bit_vector.clear(__DISCOUNTEDPRICE_ISSET_ID);
419
  }
420
 
421
  /** Returns true if field discountedPrice is set (has been asigned a value) and false otherwise */
422
  public boolean isSetDiscountedPrice() {
423
    return __isset_bit_vector.get(__DISCOUNTEDPRICE_ISSET_ID);
424
  }
425
 
426
  public void setDiscountedPriceIsSet(boolean value) {
427
    __isset_bit_vector.set(__DISCOUNTEDPRICE_ISSET_ID, value);
428
  }
429
 
553 chandransh 430
  public void setFieldValue(_Fields field, Object value) {
431
    switch (field) {
648 chandransh 432
    case CART_ID:
553 chandransh 433
      if (value == null) {
648 chandransh 434
        unsetCartId();
553 chandransh 435
      } else {
648 chandransh 436
        setCartId((Long)value);
553 chandransh 437
      }
438
      break;
439
 
440
    case ITEM_ID:
441
      if (value == null) {
442
        unsetItemId();
443
      } else {
444
        setItemId((Long)value);
445
      }
446
      break;
447
 
448
    case QUANTITY:
449
      if (value == null) {
450
        unsetQuantity();
451
      } else {
452
        setQuantity((Double)value);
453
      }
454
      break;
455
 
456
    case CREATED_ON:
457
      if (value == null) {
458
        unsetCreatedOn();
459
      } else {
460
        setCreatedOn((Long)value);
461
      }
462
      break;
463
 
464
    case UPDATED_ON:
465
      if (value == null) {
466
        unsetUpdatedOn();
467
      } else {
468
        setUpdatedOn((Long)value);
469
      }
470
      break;
471
 
472
    case LINE_STATUS:
473
      if (value == null) {
474
        unsetLineStatus();
475
      } else {
476
        setLineStatus((LineStatus)value);
477
      }
478
      break;
479
 
614 chandransh 480
    case ESTIMATE:
481
      if (value == null) {
482
        unsetEstimate();
483
      } else {
484
        setEstimate((Integer)value);
485
      }
486
      break;
487
 
1982 varun.gupt 488
    case ACTUAL_PRICE:
489
      if (value == null) {
490
        unsetActualPrice();
491
      } else {
492
        setActualPrice((Double)value);
493
      }
494
      break;
495
 
496
    case DISCOUNTED_PRICE:
497
      if (value == null) {
498
        unsetDiscountedPrice();
499
      } else {
500
        setDiscountedPrice((Double)value);
501
      }
502
      break;
503
 
553 chandransh 504
    }
505
  }
506
 
507
  public void setFieldValue(int fieldID, Object value) {
508
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
509
  }
510
 
511
  public Object getFieldValue(_Fields field) {
512
    switch (field) {
648 chandransh 513
    case CART_ID:
514
      return new Long(getCartId());
553 chandransh 515
 
516
    case ITEM_ID:
517
      return new Long(getItemId());
518
 
519
    case QUANTITY:
520
      return new Double(getQuantity());
521
 
522
    case CREATED_ON:
523
      return new Long(getCreatedOn());
524
 
525
    case UPDATED_ON:
526
      return new Long(getUpdatedOn());
527
 
528
    case LINE_STATUS:
529
      return getLineStatus();
530
 
614 chandransh 531
    case ESTIMATE:
532
      return new Integer(getEstimate());
533
 
1982 varun.gupt 534
    case ACTUAL_PRICE:
535
      return new Double(getActualPrice());
536
 
537
    case DISCOUNTED_PRICE:
538
      return new Double(getDiscountedPrice());
539
 
553 chandransh 540
    }
541
    throw new IllegalStateException();
542
  }
543
 
544
  public Object getFieldValue(int fieldId) {
545
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
546
  }
547
 
548
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
549
  public boolean isSet(_Fields field) {
550
    switch (field) {
648 chandransh 551
    case CART_ID:
552
      return isSetCartId();
553 chandransh 553
    case ITEM_ID:
554
      return isSetItemId();
555
    case QUANTITY:
556
      return isSetQuantity();
557
    case CREATED_ON:
558
      return isSetCreatedOn();
559
    case UPDATED_ON:
560
      return isSetUpdatedOn();
561
    case LINE_STATUS:
562
      return isSetLineStatus();
614 chandransh 563
    case ESTIMATE:
564
      return isSetEstimate();
1982 varun.gupt 565
    case ACTUAL_PRICE:
566
      return isSetActualPrice();
567
    case DISCOUNTED_PRICE:
568
      return isSetDiscountedPrice();
553 chandransh 569
    }
570
    throw new IllegalStateException();
571
  }
572
 
573
  public boolean isSet(int fieldID) {
574
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
575
  }
576
 
577
  @Override
578
  public boolean equals(Object that) {
579
    if (that == null)
580
      return false;
581
    if (that instanceof Line)
582
      return this.equals((Line)that);
583
    return false;
584
  }
585
 
586
  public boolean equals(Line that) {
587
    if (that == null)
588
      return false;
589
 
648 chandransh 590
    boolean this_present_cartId = true;
591
    boolean that_present_cartId = true;
592
    if (this_present_cartId || that_present_cartId) {
593
      if (!(this_present_cartId && that_present_cartId))
553 chandransh 594
        return false;
648 chandransh 595
      if (this.cartId != that.cartId)
553 chandransh 596
        return false;
597
    }
598
 
599
    boolean this_present_itemId = true;
600
    boolean that_present_itemId = true;
601
    if (this_present_itemId || that_present_itemId) {
602
      if (!(this_present_itemId && that_present_itemId))
603
        return false;
604
      if (this.itemId != that.itemId)
605
        return false;
606
    }
607
 
608
    boolean this_present_quantity = true;
609
    boolean that_present_quantity = true;
610
    if (this_present_quantity || that_present_quantity) {
611
      if (!(this_present_quantity && that_present_quantity))
612
        return false;
613
      if (this.quantity != that.quantity)
614
        return false;
615
    }
616
 
617
    boolean this_present_createdOn = true;
618
    boolean that_present_createdOn = true;
619
    if (this_present_createdOn || that_present_createdOn) {
620
      if (!(this_present_createdOn && that_present_createdOn))
621
        return false;
622
      if (this.createdOn != that.createdOn)
623
        return false;
624
    }
625
 
626
    boolean this_present_updatedOn = true;
627
    boolean that_present_updatedOn = true;
628
    if (this_present_updatedOn || that_present_updatedOn) {
629
      if (!(this_present_updatedOn && that_present_updatedOn))
630
        return false;
631
      if (this.updatedOn != that.updatedOn)
632
        return false;
633
    }
634
 
635
    boolean this_present_lineStatus = true && this.isSetLineStatus();
636
    boolean that_present_lineStatus = true && that.isSetLineStatus();
637
    if (this_present_lineStatus || that_present_lineStatus) {
638
      if (!(this_present_lineStatus && that_present_lineStatus))
639
        return false;
640
      if (!this.lineStatus.equals(that.lineStatus))
641
        return false;
642
    }
643
 
614 chandransh 644
    boolean this_present_estimate = true;
645
    boolean that_present_estimate = true;
646
    if (this_present_estimate || that_present_estimate) {
647
      if (!(this_present_estimate && that_present_estimate))
648
        return false;
649
      if (this.estimate != that.estimate)
650
        return false;
651
    }
652
 
1982 varun.gupt 653
    boolean this_present_actualPrice = true;
654
    boolean that_present_actualPrice = true;
655
    if (this_present_actualPrice || that_present_actualPrice) {
656
      if (!(this_present_actualPrice && that_present_actualPrice))
657
        return false;
658
      if (this.actualPrice != that.actualPrice)
659
        return false;
660
    }
661
 
662
    boolean this_present_discountedPrice = true;
663
    boolean that_present_discountedPrice = true;
664
    if (this_present_discountedPrice || that_present_discountedPrice) {
665
      if (!(this_present_discountedPrice && that_present_discountedPrice))
666
        return false;
667
      if (this.discountedPrice != that.discountedPrice)
668
        return false;
669
    }
670
 
553 chandransh 671
    return true;
672
  }
673
 
674
  @Override
675
  public int hashCode() {
676
    return 0;
677
  }
678
 
679
  public int compareTo(Line other) {
680
    if (!getClass().equals(other.getClass())) {
681
      return getClass().getName().compareTo(other.getClass().getName());
682
    }
683
 
684
    int lastComparison = 0;
685
    Line typedOther = (Line)other;
686
 
648 chandransh 687
    lastComparison = Boolean.valueOf(isSetCartId()).compareTo(isSetCartId());
553 chandransh 688
    if (lastComparison != 0) {
689
      return lastComparison;
690
    }
648 chandransh 691
    lastComparison = TBaseHelper.compareTo(cartId, typedOther.cartId);
553 chandransh 692
    if (lastComparison != 0) {
693
      return lastComparison;
694
    }
695
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
696
    if (lastComparison != 0) {
697
      return lastComparison;
698
    }
699
    lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
700
    if (lastComparison != 0) {
701
      return lastComparison;
702
    }
703
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(isSetQuantity());
704
    if (lastComparison != 0) {
705
      return lastComparison;
706
    }
707
    lastComparison = TBaseHelper.compareTo(quantity, typedOther.quantity);
708
    if (lastComparison != 0) {
709
      return lastComparison;
710
    }
711
    lastComparison = Boolean.valueOf(isSetCreatedOn()).compareTo(isSetCreatedOn());
712
    if (lastComparison != 0) {
713
      return lastComparison;
714
    }
715
    lastComparison = TBaseHelper.compareTo(createdOn, typedOther.createdOn);
716
    if (lastComparison != 0) {
717
      return lastComparison;
718
    }
719
    lastComparison = Boolean.valueOf(isSetUpdatedOn()).compareTo(isSetUpdatedOn());
720
    if (lastComparison != 0) {
721
      return lastComparison;
722
    }
723
    lastComparison = TBaseHelper.compareTo(updatedOn, typedOther.updatedOn);
724
    if (lastComparison != 0) {
725
      return lastComparison;
726
    }
727
    lastComparison = Boolean.valueOf(isSetLineStatus()).compareTo(isSetLineStatus());
728
    if (lastComparison != 0) {
729
      return lastComparison;
730
    }
731
    lastComparison = TBaseHelper.compareTo(lineStatus, typedOther.lineStatus);
732
    if (lastComparison != 0) {
733
      return lastComparison;
734
    }
614 chandransh 735
    lastComparison = Boolean.valueOf(isSetEstimate()).compareTo(isSetEstimate());
736
    if (lastComparison != 0) {
737
      return lastComparison;
738
    }
739
    lastComparison = TBaseHelper.compareTo(estimate, typedOther.estimate);
740
    if (lastComparison != 0) {
741
      return lastComparison;
742
    }
1982 varun.gupt 743
    lastComparison = Boolean.valueOf(isSetActualPrice()).compareTo(isSetActualPrice());
744
    if (lastComparison != 0) {
745
      return lastComparison;
746
    }
747
    lastComparison = TBaseHelper.compareTo(actualPrice, typedOther.actualPrice);
748
    if (lastComparison != 0) {
749
      return lastComparison;
750
    }
751
    lastComparison = Boolean.valueOf(isSetDiscountedPrice()).compareTo(isSetDiscountedPrice());
752
    if (lastComparison != 0) {
753
      return lastComparison;
754
    }
755
    lastComparison = TBaseHelper.compareTo(discountedPrice, typedOther.discountedPrice);
756
    if (lastComparison != 0) {
757
      return lastComparison;
758
    }
553 chandransh 759
    return 0;
760
  }
761
 
762
  public void read(TProtocol iprot) throws TException {
763
    TField field;
764
    iprot.readStructBegin();
765
    while (true)
766
    {
767
      field = iprot.readFieldBegin();
768
      if (field.type == TType.STOP) { 
769
        break;
770
      }
771
      _Fields fieldId = _Fields.findByThriftId(field.id);
772
      if (fieldId == null) {
773
        TProtocolUtil.skip(iprot, field.type);
774
      } else {
775
        switch (fieldId) {
648 chandransh 776
          case CART_ID:
553 chandransh 777
            if (field.type == TType.I64) {
648 chandransh 778
              this.cartId = iprot.readI64();
779
              setCartIdIsSet(true);
553 chandransh 780
            } else { 
781
              TProtocolUtil.skip(iprot, field.type);
782
            }
783
            break;
784
          case ITEM_ID:
785
            if (field.type == TType.I64) {
786
              this.itemId = iprot.readI64();
787
              setItemIdIsSet(true);
788
            } else { 
789
              TProtocolUtil.skip(iprot, field.type);
790
            }
791
            break;
792
          case QUANTITY:
793
            if (field.type == TType.DOUBLE) {
794
              this.quantity = iprot.readDouble();
795
              setQuantityIsSet(true);
796
            } else { 
797
              TProtocolUtil.skip(iprot, field.type);
798
            }
799
            break;
800
          case CREATED_ON:
801
            if (field.type == TType.I64) {
802
              this.createdOn = iprot.readI64();
803
              setCreatedOnIsSet(true);
804
            } else { 
805
              TProtocolUtil.skip(iprot, field.type);
806
            }
807
            break;
808
          case UPDATED_ON:
809
            if (field.type == TType.I64) {
810
              this.updatedOn = iprot.readI64();
811
              setUpdatedOnIsSet(true);
812
            } else { 
813
              TProtocolUtil.skip(iprot, field.type);
814
            }
815
            break;
816
          case LINE_STATUS:
817
            if (field.type == TType.I32) {
818
              this.lineStatus = LineStatus.findByValue(iprot.readI32());
819
            } else { 
820
              TProtocolUtil.skip(iprot, field.type);
821
            }
822
            break;
614 chandransh 823
          case ESTIMATE:
824
            if (field.type == TType.I32) {
825
              this.estimate = iprot.readI32();
826
              setEstimateIsSet(true);
827
            } else { 
828
              TProtocolUtil.skip(iprot, field.type);
829
            }
830
            break;
1982 varun.gupt 831
          case ACTUAL_PRICE:
832
            if (field.type == TType.DOUBLE) {
833
              this.actualPrice = iprot.readDouble();
834
              setActualPriceIsSet(true);
835
            } else { 
836
              TProtocolUtil.skip(iprot, field.type);
837
            }
838
            break;
839
          case DISCOUNTED_PRICE:
840
            if (field.type == TType.DOUBLE) {
841
              this.discountedPrice = iprot.readDouble();
842
              setDiscountedPriceIsSet(true);
843
            } else { 
844
              TProtocolUtil.skip(iprot, field.type);
845
            }
846
            break;
553 chandransh 847
        }
848
        iprot.readFieldEnd();
849
      }
850
    }
851
    iprot.readStructEnd();
852
    validate();
853
  }
854
 
855
  public void write(TProtocol oprot) throws TException {
856
    validate();
857
 
858
    oprot.writeStructBegin(STRUCT_DESC);
648 chandransh 859
    oprot.writeFieldBegin(CART_ID_FIELD_DESC);
860
    oprot.writeI64(this.cartId);
553 chandransh 861
    oprot.writeFieldEnd();
862
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
863
    oprot.writeI64(this.itemId);
864
    oprot.writeFieldEnd();
865
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
866
    oprot.writeDouble(this.quantity);
867
    oprot.writeFieldEnd();
868
    oprot.writeFieldBegin(CREATED_ON_FIELD_DESC);
869
    oprot.writeI64(this.createdOn);
870
    oprot.writeFieldEnd();
871
    oprot.writeFieldBegin(UPDATED_ON_FIELD_DESC);
872
    oprot.writeI64(this.updatedOn);
873
    oprot.writeFieldEnd();
874
    if (this.lineStatus != null) {
875
      oprot.writeFieldBegin(LINE_STATUS_FIELD_DESC);
876
      oprot.writeI32(this.lineStatus.getValue());
877
      oprot.writeFieldEnd();
878
    }
614 chandransh 879
    oprot.writeFieldBegin(ESTIMATE_FIELD_DESC);
880
    oprot.writeI32(this.estimate);
881
    oprot.writeFieldEnd();
1982 varun.gupt 882
    oprot.writeFieldBegin(ACTUAL_PRICE_FIELD_DESC);
883
    oprot.writeDouble(this.actualPrice);
884
    oprot.writeFieldEnd();
885
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
886
    oprot.writeDouble(this.discountedPrice);
887
    oprot.writeFieldEnd();
553 chandransh 888
    oprot.writeFieldStop();
889
    oprot.writeStructEnd();
890
  }
891
 
892
  @Override
893
  public String toString() {
894
    StringBuilder sb = new StringBuilder("Line(");
895
    boolean first = true;
896
 
648 chandransh 897
    sb.append("cartId:");
898
    sb.append(this.cartId);
553 chandransh 899
    first = false;
900
    if (!first) sb.append(", ");
901
    sb.append("itemId:");
902
    sb.append(this.itemId);
903
    first = false;
904
    if (!first) sb.append(", ");
905
    sb.append("quantity:");
906
    sb.append(this.quantity);
907
    first = false;
908
    if (!first) sb.append(", ");
909
    sb.append("createdOn:");
910
    sb.append(this.createdOn);
911
    first = false;
912
    if (!first) sb.append(", ");
913
    sb.append("updatedOn:");
914
    sb.append(this.updatedOn);
915
    first = false;
916
    if (!first) sb.append(", ");
917
    sb.append("lineStatus:");
918
    if (this.lineStatus == null) {
919
      sb.append("null");
920
    } else {
921
      String lineStatus_name = lineStatus.name();
922
      if (lineStatus_name != null) {
923
        sb.append(lineStatus_name);
924
        sb.append(" (");
925
      }
926
      sb.append(this.lineStatus);
927
      if (lineStatus_name != null) {
928
        sb.append(")");
929
      }
930
    }
931
    first = false;
614 chandransh 932
    if (!first) sb.append(", ");
933
    sb.append("estimate:");
934
    sb.append(this.estimate);
935
    first = false;
1982 varun.gupt 936
    if (!first) sb.append(", ");
937
    sb.append("actualPrice:");
938
    sb.append(this.actualPrice);
939
    first = false;
940
    if (!first) sb.append(", ");
941
    sb.append("discountedPrice:");
942
    sb.append(this.discountedPrice);
943
    first = false;
553 chandransh 944
    sb.append(")");
945
    return sb.toString();
946
  }
947
 
948
  public void validate() throws TException {
949
    // check for required fields
950
  }
951
 
952
}
953