Subversion Repositories SmartDukaan

Rev

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