Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2820 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.warehouse;
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 LineItem implements TBase<LineItem._Fields>, java.io.Serializable, Cloneable, Comparable<LineItem> {
27
  private static final TStruct STRUCT_DESC = new TStruct("LineItem");
28
 
29
  private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)1);
30
  private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);
31
  private static final TField PRODUCT_GROUP_FIELD_DESC = new TField("productGroup", TType.STRING, (short)3);
32
  private static final TField BRAND_FIELD_DESC = new TField("brand", TType.STRING, (short)4);
33
  private static final TField MODEL_NUMBER_FIELD_DESC = new TField("modelNumber", TType.STRING, (short)5);
34
  private static final TField MODEL_NAME_FIELD_DESC = new TField("modelName", TType.STRING, (short)6);
35
  private static final TField COLOR_FIELD_DESC = new TField("color", TType.STRING, (short)7);
36
  private static final TField ITEM_NUMBER_FIELD_DESC = new TField("itemNumber", TType.STRING, (short)8);
37
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)9);
38
  private static final TField UNFULFILLED_QUANTITY_FIELD_DESC = new TField("unfulfilledQuantity", TType.DOUBLE, (short)10);
39
  private static final TField CREATED_AT_FIELD_DESC = new TField("createdAt", TType.I64, (short)11);
40
  private static final TField UNIT_PRICE_FIELD_DESC = new TField("unitPrice", TType.DOUBLE, (short)12);
41
  private static final TField FULFILLED_FIELD_DESC = new TField("fulfilled", TType.BOOL, (short)13);
42
 
43
  private long orderId;
44
  private long itemId;
45
  private String productGroup;
46
  private String brand;
47
  private String modelNumber;
48
  private String modelName;
49
  private String color;
50
  private String itemNumber;
51
  private double quantity;
52
  private double unfulfilledQuantity;
53
  private long createdAt;
54
  private double unitPrice;
55
  private boolean fulfilled;
56
 
57
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
58
  public enum _Fields implements TFieldIdEnum {
59
    ORDER_ID((short)1, "orderId"),
60
    ITEM_ID((short)2, "itemId"),
61
    PRODUCT_GROUP((short)3, "productGroup"),
62
    BRAND((short)4, "brand"),
63
    MODEL_NUMBER((short)5, "modelNumber"),
64
    MODEL_NAME((short)6, "modelName"),
65
    COLOR((short)7, "color"),
66
    ITEM_NUMBER((short)8, "itemNumber"),
67
    QUANTITY((short)9, "quantity"),
68
    UNFULFILLED_QUANTITY((short)10, "unfulfilledQuantity"),
69
    CREATED_AT((short)11, "createdAt"),
70
    UNIT_PRICE((short)12, "unitPrice"),
71
    FULFILLED((short)13, "fulfilled");
72
 
73
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
74
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
75
 
76
    static {
77
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
78
        byId.put((int)field._thriftId, field);
79
        byName.put(field.getFieldName(), field);
80
      }
81
    }
82
 
83
    /**
84
     * Find the _Fields constant that matches fieldId, or null if its not found.
85
     */
86
    public static _Fields findByThriftId(int fieldId) {
87
      return byId.get(fieldId);
88
    }
89
 
90
    /**
91
     * Find the _Fields constant that matches fieldId, throwing an exception
92
     * if it is not found.
93
     */
94
    public static _Fields findByThriftIdOrThrow(int fieldId) {
95
      _Fields fields = findByThriftId(fieldId);
96
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
97
      return fields;
98
    }
99
 
100
    /**
101
     * Find the _Fields constant that matches name, or null if its not found.
102
     */
103
    public static _Fields findByName(String name) {
104
      return byName.get(name);
105
    }
106
 
107
    private final short _thriftId;
108
    private final String _fieldName;
109
 
110
    _Fields(short thriftId, String fieldName) {
111
      _thriftId = thriftId;
112
      _fieldName = fieldName;
113
    }
114
 
115
    public short getThriftFieldId() {
116
      return _thriftId;
117
    }
118
 
119
    public String getFieldName() {
120
      return _fieldName;
121
    }
122
  }
123
 
124
  // isset id assignments
125
  private static final int __ORDERID_ISSET_ID = 0;
126
  private static final int __ITEMID_ISSET_ID = 1;
127
  private static final int __QUANTITY_ISSET_ID = 2;
128
  private static final int __UNFULFILLEDQUANTITY_ISSET_ID = 3;
129
  private static final int __CREATEDAT_ISSET_ID = 4;
130
  private static final int __UNITPRICE_ISSET_ID = 5;
131
  private static final int __FULFILLED_ISSET_ID = 6;
132
  private BitSet __isset_bit_vector = new BitSet(7);
133
 
134
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
135
    put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
136
        new FieldValueMetaData(TType.I64)));
137
    put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
138
        new FieldValueMetaData(TType.I64)));
139
    put(_Fields.PRODUCT_GROUP, new FieldMetaData("productGroup", TFieldRequirementType.DEFAULT, 
140
        new FieldValueMetaData(TType.STRING)));
141
    put(_Fields.BRAND, new FieldMetaData("brand", TFieldRequirementType.DEFAULT, 
142
        new FieldValueMetaData(TType.STRING)));
143
    put(_Fields.MODEL_NUMBER, new FieldMetaData("modelNumber", TFieldRequirementType.DEFAULT, 
144
        new FieldValueMetaData(TType.STRING)));
145
    put(_Fields.MODEL_NAME, new FieldMetaData("modelName", TFieldRequirementType.DEFAULT, 
146
        new FieldValueMetaData(TType.STRING)));
147
    put(_Fields.COLOR, new FieldMetaData("color", TFieldRequirementType.DEFAULT, 
148
        new FieldValueMetaData(TType.STRING)));
149
    put(_Fields.ITEM_NUMBER, new FieldMetaData("itemNumber", TFieldRequirementType.DEFAULT, 
150
        new FieldValueMetaData(TType.STRING)));
151
    put(_Fields.QUANTITY, new FieldMetaData("quantity", TFieldRequirementType.DEFAULT, 
152
        new FieldValueMetaData(TType.DOUBLE)));
153
    put(_Fields.UNFULFILLED_QUANTITY, new FieldMetaData("unfulfilledQuantity", TFieldRequirementType.DEFAULT, 
154
        new FieldValueMetaData(TType.DOUBLE)));
155
    put(_Fields.CREATED_AT, new FieldMetaData("createdAt", TFieldRequirementType.DEFAULT, 
156
        new FieldValueMetaData(TType.I64)));
157
    put(_Fields.UNIT_PRICE, new FieldMetaData("unitPrice", TFieldRequirementType.DEFAULT, 
158
        new FieldValueMetaData(TType.DOUBLE)));
159
    put(_Fields.FULFILLED, new FieldMetaData("fulfilled", TFieldRequirementType.DEFAULT, 
160
        new FieldValueMetaData(TType.BOOL)));
161
  }});
162
 
163
  static {
164
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
165
  }
166
 
167
  public LineItem() {
168
  }
169
 
170
  public LineItem(
171
    long orderId,
172
    long itemId,
173
    String productGroup,
174
    String brand,
175
    String modelNumber,
176
    String modelName,
177
    String color,
178
    String itemNumber,
179
    double quantity,
180
    double unfulfilledQuantity,
181
    long createdAt,
182
    double unitPrice,
183
    boolean fulfilled)
184
  {
185
    this();
186
    this.orderId = orderId;
187
    setOrderIdIsSet(true);
188
    this.itemId = itemId;
189
    setItemIdIsSet(true);
190
    this.productGroup = productGroup;
191
    this.brand = brand;
192
    this.modelNumber = modelNumber;
193
    this.modelName = modelName;
194
    this.color = color;
195
    this.itemNumber = itemNumber;
196
    this.quantity = quantity;
197
    setQuantityIsSet(true);
198
    this.unfulfilledQuantity = unfulfilledQuantity;
199
    setUnfulfilledQuantityIsSet(true);
200
    this.createdAt = createdAt;
201
    setCreatedAtIsSet(true);
202
    this.unitPrice = unitPrice;
203
    setUnitPriceIsSet(true);
204
    this.fulfilled = fulfilled;
205
    setFulfilledIsSet(true);
206
  }
207
 
208
  /**
209
   * Performs a deep copy on <i>other</i>.
210
   */
211
  public LineItem(LineItem other) {
212
    __isset_bit_vector.clear();
213
    __isset_bit_vector.or(other.__isset_bit_vector);
214
    this.orderId = other.orderId;
215
    this.itemId = other.itemId;
216
    if (other.isSetProductGroup()) {
217
      this.productGroup = other.productGroup;
218
    }
219
    if (other.isSetBrand()) {
220
      this.brand = other.brand;
221
    }
222
    if (other.isSetModelNumber()) {
223
      this.modelNumber = other.modelNumber;
224
    }
225
    if (other.isSetModelName()) {
226
      this.modelName = other.modelName;
227
    }
228
    if (other.isSetColor()) {
229
      this.color = other.color;
230
    }
231
    if (other.isSetItemNumber()) {
232
      this.itemNumber = other.itemNumber;
233
    }
234
    this.quantity = other.quantity;
235
    this.unfulfilledQuantity = other.unfulfilledQuantity;
236
    this.createdAt = other.createdAt;
237
    this.unitPrice = other.unitPrice;
238
    this.fulfilled = other.fulfilled;
239
  }
240
 
241
  public LineItem deepCopy() {
242
    return new LineItem(this);
243
  }
244
 
245
  @Deprecated
246
  public LineItem clone() {
247
    return new LineItem(this);
248
  }
249
 
250
  public long getOrderId() {
251
    return this.orderId;
252
  }
253
 
254
  public LineItem setOrderId(long orderId) {
255
    this.orderId = orderId;
256
    setOrderIdIsSet(true);
257
    return this;
258
  }
259
 
260
  public void unsetOrderId() {
261
    __isset_bit_vector.clear(__ORDERID_ISSET_ID);
262
  }
263
 
264
  /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
265
  public boolean isSetOrderId() {
266
    return __isset_bit_vector.get(__ORDERID_ISSET_ID);
267
  }
268
 
269
  public void setOrderIdIsSet(boolean value) {
270
    __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
271
  }
272
 
273
  public long getItemId() {
274
    return this.itemId;
275
  }
276
 
277
  public LineItem setItemId(long itemId) {
278
    this.itemId = itemId;
279
    setItemIdIsSet(true);
280
    return this;
281
  }
282
 
283
  public void unsetItemId() {
284
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
285
  }
286
 
287
  /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
288
  public boolean isSetItemId() {
289
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
290
  }
291
 
292
  public void setItemIdIsSet(boolean value) {
293
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
294
  }
295
 
296
  public String getProductGroup() {
297
    return this.productGroup;
298
  }
299
 
300
  public LineItem setProductGroup(String productGroup) {
301
    this.productGroup = productGroup;
302
    return this;
303
  }
304
 
305
  public void unsetProductGroup() {
306
    this.productGroup = null;
307
  }
308
 
309
  /** Returns true if field productGroup is set (has been asigned a value) and false otherwise */
310
  public boolean isSetProductGroup() {
311
    return this.productGroup != null;
312
  }
313
 
314
  public void setProductGroupIsSet(boolean value) {
315
    if (!value) {
316
      this.productGroup = null;
317
    }
318
  }
319
 
320
  public String getBrand() {
321
    return this.brand;
322
  }
323
 
324
  public LineItem setBrand(String brand) {
325
    this.brand = brand;
326
    return this;
327
  }
328
 
329
  public void unsetBrand() {
330
    this.brand = null;
331
  }
332
 
333
  /** Returns true if field brand is set (has been asigned a value) and false otherwise */
334
  public boolean isSetBrand() {
335
    return this.brand != null;
336
  }
337
 
338
  public void setBrandIsSet(boolean value) {
339
    if (!value) {
340
      this.brand = null;
341
    }
342
  }
343
 
344
  public String getModelNumber() {
345
    return this.modelNumber;
346
  }
347
 
348
  public LineItem setModelNumber(String modelNumber) {
349
    this.modelNumber = modelNumber;
350
    return this;
351
  }
352
 
353
  public void unsetModelNumber() {
354
    this.modelNumber = null;
355
  }
356
 
357
  /** Returns true if field modelNumber is set (has been asigned a value) and false otherwise */
358
  public boolean isSetModelNumber() {
359
    return this.modelNumber != null;
360
  }
361
 
362
  public void setModelNumberIsSet(boolean value) {
363
    if (!value) {
364
      this.modelNumber = null;
365
    }
366
  }
367
 
368
  public String getModelName() {
369
    return this.modelName;
370
  }
371
 
372
  public LineItem setModelName(String modelName) {
373
    this.modelName = modelName;
374
    return this;
375
  }
376
 
377
  public void unsetModelName() {
378
    this.modelName = null;
379
  }
380
 
381
  /** Returns true if field modelName is set (has been asigned a value) and false otherwise */
382
  public boolean isSetModelName() {
383
    return this.modelName != null;
384
  }
385
 
386
  public void setModelNameIsSet(boolean value) {
387
    if (!value) {
388
      this.modelName = null;
389
    }
390
  }
391
 
392
  public String getColor() {
393
    return this.color;
394
  }
395
 
396
  public LineItem setColor(String color) {
397
    this.color = color;
398
    return this;
399
  }
400
 
401
  public void unsetColor() {
402
    this.color = null;
403
  }
404
 
405
  /** Returns true if field color is set (has been asigned a value) and false otherwise */
406
  public boolean isSetColor() {
407
    return this.color != null;
408
  }
409
 
410
  public void setColorIsSet(boolean value) {
411
    if (!value) {
412
      this.color = null;
413
    }
414
  }
415
 
416
  public String getItemNumber() {
417
    return this.itemNumber;
418
  }
419
 
420
  public LineItem setItemNumber(String itemNumber) {
421
    this.itemNumber = itemNumber;
422
    return this;
423
  }
424
 
425
  public void unsetItemNumber() {
426
    this.itemNumber = null;
427
  }
428
 
429
  /** Returns true if field itemNumber is set (has been asigned a value) and false otherwise */
430
  public boolean isSetItemNumber() {
431
    return this.itemNumber != null;
432
  }
433
 
434
  public void setItemNumberIsSet(boolean value) {
435
    if (!value) {
436
      this.itemNumber = null;
437
    }
438
  }
439
 
440
  public double getQuantity() {
441
    return this.quantity;
442
  }
443
 
444
  public LineItem setQuantity(double quantity) {
445
    this.quantity = quantity;
446
    setQuantityIsSet(true);
447
    return this;
448
  }
449
 
450
  public void unsetQuantity() {
451
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
452
  }
453
 
454
  /** Returns true if field quantity is set (has been asigned a value) and false otherwise */
455
  public boolean isSetQuantity() {
456
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
457
  }
458
 
459
  public void setQuantityIsSet(boolean value) {
460
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
461
  }
462
 
463
  public double getUnfulfilledQuantity() {
464
    return this.unfulfilledQuantity;
465
  }
466
 
467
  public LineItem setUnfulfilledQuantity(double unfulfilledQuantity) {
468
    this.unfulfilledQuantity = unfulfilledQuantity;
469
    setUnfulfilledQuantityIsSet(true);
470
    return this;
471
  }
472
 
473
  public void unsetUnfulfilledQuantity() {
474
    __isset_bit_vector.clear(__UNFULFILLEDQUANTITY_ISSET_ID);
475
  }
476
 
477
  /** Returns true if field unfulfilledQuantity is set (has been asigned a value) and false otherwise */
478
  public boolean isSetUnfulfilledQuantity() {
479
    return __isset_bit_vector.get(__UNFULFILLEDQUANTITY_ISSET_ID);
480
  }
481
 
482
  public void setUnfulfilledQuantityIsSet(boolean value) {
483
    __isset_bit_vector.set(__UNFULFILLEDQUANTITY_ISSET_ID, value);
484
  }
485
 
486
  public long getCreatedAt() {
487
    return this.createdAt;
488
  }
489
 
490
  public LineItem setCreatedAt(long createdAt) {
491
    this.createdAt = createdAt;
492
    setCreatedAtIsSet(true);
493
    return this;
494
  }
495
 
496
  public void unsetCreatedAt() {
497
    __isset_bit_vector.clear(__CREATEDAT_ISSET_ID);
498
  }
499
 
500
  /** Returns true if field createdAt is set (has been asigned a value) and false otherwise */
501
  public boolean isSetCreatedAt() {
502
    return __isset_bit_vector.get(__CREATEDAT_ISSET_ID);
503
  }
504
 
505
  public void setCreatedAtIsSet(boolean value) {
506
    __isset_bit_vector.set(__CREATEDAT_ISSET_ID, value);
507
  }
508
 
509
  public double getUnitPrice() {
510
    return this.unitPrice;
511
  }
512
 
513
  public LineItem setUnitPrice(double unitPrice) {
514
    this.unitPrice = unitPrice;
515
    setUnitPriceIsSet(true);
516
    return this;
517
  }
518
 
519
  public void unsetUnitPrice() {
520
    __isset_bit_vector.clear(__UNITPRICE_ISSET_ID);
521
  }
522
 
523
  /** Returns true if field unitPrice is set (has been asigned a value) and false otherwise */
524
  public boolean isSetUnitPrice() {
525
    return __isset_bit_vector.get(__UNITPRICE_ISSET_ID);
526
  }
527
 
528
  public void setUnitPriceIsSet(boolean value) {
529
    __isset_bit_vector.set(__UNITPRICE_ISSET_ID, value);
530
  }
531
 
532
  public boolean isFulfilled() {
533
    return this.fulfilled;
534
  }
535
 
536
  public LineItem setFulfilled(boolean fulfilled) {
537
    this.fulfilled = fulfilled;
538
    setFulfilledIsSet(true);
539
    return this;
540
  }
541
 
542
  public void unsetFulfilled() {
543
    __isset_bit_vector.clear(__FULFILLED_ISSET_ID);
544
  }
545
 
546
  /** Returns true if field fulfilled is set (has been asigned a value) and false otherwise */
547
  public boolean isSetFulfilled() {
548
    return __isset_bit_vector.get(__FULFILLED_ISSET_ID);
549
  }
550
 
551
  public void setFulfilledIsSet(boolean value) {
552
    __isset_bit_vector.set(__FULFILLED_ISSET_ID, value);
553
  }
554
 
555
  public void setFieldValue(_Fields field, Object value) {
556
    switch (field) {
557
    case ORDER_ID:
558
      if (value == null) {
559
        unsetOrderId();
560
      } else {
561
        setOrderId((Long)value);
562
      }
563
      break;
564
 
565
    case ITEM_ID:
566
      if (value == null) {
567
        unsetItemId();
568
      } else {
569
        setItemId((Long)value);
570
      }
571
      break;
572
 
573
    case PRODUCT_GROUP:
574
      if (value == null) {
575
        unsetProductGroup();
576
      } else {
577
        setProductGroup((String)value);
578
      }
579
      break;
580
 
581
    case BRAND:
582
      if (value == null) {
583
        unsetBrand();
584
      } else {
585
        setBrand((String)value);
586
      }
587
      break;
588
 
589
    case MODEL_NUMBER:
590
      if (value == null) {
591
        unsetModelNumber();
592
      } else {
593
        setModelNumber((String)value);
594
      }
595
      break;
596
 
597
    case MODEL_NAME:
598
      if (value == null) {
599
        unsetModelName();
600
      } else {
601
        setModelName((String)value);
602
      }
603
      break;
604
 
605
    case COLOR:
606
      if (value == null) {
607
        unsetColor();
608
      } else {
609
        setColor((String)value);
610
      }
611
      break;
612
 
613
    case ITEM_NUMBER:
614
      if (value == null) {
615
        unsetItemNumber();
616
      } else {
617
        setItemNumber((String)value);
618
      }
619
      break;
620
 
621
    case QUANTITY:
622
      if (value == null) {
623
        unsetQuantity();
624
      } else {
625
        setQuantity((Double)value);
626
      }
627
      break;
628
 
629
    case UNFULFILLED_QUANTITY:
630
      if (value == null) {
631
        unsetUnfulfilledQuantity();
632
      } else {
633
        setUnfulfilledQuantity((Double)value);
634
      }
635
      break;
636
 
637
    case CREATED_AT:
638
      if (value == null) {
639
        unsetCreatedAt();
640
      } else {
641
        setCreatedAt((Long)value);
642
      }
643
      break;
644
 
645
    case UNIT_PRICE:
646
      if (value == null) {
647
        unsetUnitPrice();
648
      } else {
649
        setUnitPrice((Double)value);
650
      }
651
      break;
652
 
653
    case FULFILLED:
654
      if (value == null) {
655
        unsetFulfilled();
656
      } else {
657
        setFulfilled((Boolean)value);
658
      }
659
      break;
660
 
661
    }
662
  }
663
 
664
  public void setFieldValue(int fieldID, Object value) {
665
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
666
  }
667
 
668
  public Object getFieldValue(_Fields field) {
669
    switch (field) {
670
    case ORDER_ID:
671
      return new Long(getOrderId());
672
 
673
    case ITEM_ID:
674
      return new Long(getItemId());
675
 
676
    case PRODUCT_GROUP:
677
      return getProductGroup();
678
 
679
    case BRAND:
680
      return getBrand();
681
 
682
    case MODEL_NUMBER:
683
      return getModelNumber();
684
 
685
    case MODEL_NAME:
686
      return getModelName();
687
 
688
    case COLOR:
689
      return getColor();
690
 
691
    case ITEM_NUMBER:
692
      return getItemNumber();
693
 
694
    case QUANTITY:
695
      return new Double(getQuantity());
696
 
697
    case UNFULFILLED_QUANTITY:
698
      return new Double(getUnfulfilledQuantity());
699
 
700
    case CREATED_AT:
701
      return new Long(getCreatedAt());
702
 
703
    case UNIT_PRICE:
704
      return new Double(getUnitPrice());
705
 
706
    case FULFILLED:
707
      return new Boolean(isFulfilled());
708
 
709
    }
710
    throw new IllegalStateException();
711
  }
712
 
713
  public Object getFieldValue(int fieldId) {
714
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
715
  }
716
 
717
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
718
  public boolean isSet(_Fields field) {
719
    switch (field) {
720
    case ORDER_ID:
721
      return isSetOrderId();
722
    case ITEM_ID:
723
      return isSetItemId();
724
    case PRODUCT_GROUP:
725
      return isSetProductGroup();
726
    case BRAND:
727
      return isSetBrand();
728
    case MODEL_NUMBER:
729
      return isSetModelNumber();
730
    case MODEL_NAME:
731
      return isSetModelName();
732
    case COLOR:
733
      return isSetColor();
734
    case ITEM_NUMBER:
735
      return isSetItemNumber();
736
    case QUANTITY:
737
      return isSetQuantity();
738
    case UNFULFILLED_QUANTITY:
739
      return isSetUnfulfilledQuantity();
740
    case CREATED_AT:
741
      return isSetCreatedAt();
742
    case UNIT_PRICE:
743
      return isSetUnitPrice();
744
    case FULFILLED:
745
      return isSetFulfilled();
746
    }
747
    throw new IllegalStateException();
748
  }
749
 
750
  public boolean isSet(int fieldID) {
751
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
752
  }
753
 
754
  @Override
755
  public boolean equals(Object that) {
756
    if (that == null)
757
      return false;
758
    if (that instanceof LineItem)
759
      return this.equals((LineItem)that);
760
    return false;
761
  }
762
 
763
  public boolean equals(LineItem that) {
764
    if (that == null)
765
      return false;
766
 
767
    boolean this_present_orderId = true;
768
    boolean that_present_orderId = true;
769
    if (this_present_orderId || that_present_orderId) {
770
      if (!(this_present_orderId && that_present_orderId))
771
        return false;
772
      if (this.orderId != that.orderId)
773
        return false;
774
    }
775
 
776
    boolean this_present_itemId = true;
777
    boolean that_present_itemId = true;
778
    if (this_present_itemId || that_present_itemId) {
779
      if (!(this_present_itemId && that_present_itemId))
780
        return false;
781
      if (this.itemId != that.itemId)
782
        return false;
783
    }
784
 
785
    boolean this_present_productGroup = true && this.isSetProductGroup();
786
    boolean that_present_productGroup = true && that.isSetProductGroup();
787
    if (this_present_productGroup || that_present_productGroup) {
788
      if (!(this_present_productGroup && that_present_productGroup))
789
        return false;
790
      if (!this.productGroup.equals(that.productGroup))
791
        return false;
792
    }
793
 
794
    boolean this_present_brand = true && this.isSetBrand();
795
    boolean that_present_brand = true && that.isSetBrand();
796
    if (this_present_brand || that_present_brand) {
797
      if (!(this_present_brand && that_present_brand))
798
        return false;
799
      if (!this.brand.equals(that.brand))
800
        return false;
801
    }
802
 
803
    boolean this_present_modelNumber = true && this.isSetModelNumber();
804
    boolean that_present_modelNumber = true && that.isSetModelNumber();
805
    if (this_present_modelNumber || that_present_modelNumber) {
806
      if (!(this_present_modelNumber && that_present_modelNumber))
807
        return false;
808
      if (!this.modelNumber.equals(that.modelNumber))
809
        return false;
810
    }
811
 
812
    boolean this_present_modelName = true && this.isSetModelName();
813
    boolean that_present_modelName = true && that.isSetModelName();
814
    if (this_present_modelName || that_present_modelName) {
815
      if (!(this_present_modelName && that_present_modelName))
816
        return false;
817
      if (!this.modelName.equals(that.modelName))
818
        return false;
819
    }
820
 
821
    boolean this_present_color = true && this.isSetColor();
822
    boolean that_present_color = true && that.isSetColor();
823
    if (this_present_color || that_present_color) {
824
      if (!(this_present_color && that_present_color))
825
        return false;
826
      if (!this.color.equals(that.color))
827
        return false;
828
    }
829
 
830
    boolean this_present_itemNumber = true && this.isSetItemNumber();
831
    boolean that_present_itemNumber = true && that.isSetItemNumber();
832
    if (this_present_itemNumber || that_present_itemNumber) {
833
      if (!(this_present_itemNumber && that_present_itemNumber))
834
        return false;
835
      if (!this.itemNumber.equals(that.itemNumber))
836
        return false;
837
    }
838
 
839
    boolean this_present_quantity = true;
840
    boolean that_present_quantity = true;
841
    if (this_present_quantity || that_present_quantity) {
842
      if (!(this_present_quantity && that_present_quantity))
843
        return false;
844
      if (this.quantity != that.quantity)
845
        return false;
846
    }
847
 
848
    boolean this_present_unfulfilledQuantity = true;
849
    boolean that_present_unfulfilledQuantity = true;
850
    if (this_present_unfulfilledQuantity || that_present_unfulfilledQuantity) {
851
      if (!(this_present_unfulfilledQuantity && that_present_unfulfilledQuantity))
852
        return false;
853
      if (this.unfulfilledQuantity != that.unfulfilledQuantity)
854
        return false;
855
    }
856
 
857
    boolean this_present_createdAt = true;
858
    boolean that_present_createdAt = true;
859
    if (this_present_createdAt || that_present_createdAt) {
860
      if (!(this_present_createdAt && that_present_createdAt))
861
        return false;
862
      if (this.createdAt != that.createdAt)
863
        return false;
864
    }
865
 
866
    boolean this_present_unitPrice = true;
867
    boolean that_present_unitPrice = true;
868
    if (this_present_unitPrice || that_present_unitPrice) {
869
      if (!(this_present_unitPrice && that_present_unitPrice))
870
        return false;
871
      if (this.unitPrice != that.unitPrice)
872
        return false;
873
    }
874
 
875
    boolean this_present_fulfilled = true;
876
    boolean that_present_fulfilled = true;
877
    if (this_present_fulfilled || that_present_fulfilled) {
878
      if (!(this_present_fulfilled && that_present_fulfilled))
879
        return false;
880
      if (this.fulfilled != that.fulfilled)
881
        return false;
882
    }
883
 
884
    return true;
885
  }
886
 
887
  @Override
888
  public int hashCode() {
889
    return 0;
890
  }
891
 
892
  public int compareTo(LineItem other) {
893
    if (!getClass().equals(other.getClass())) {
894
      return getClass().getName().compareTo(other.getClass().getName());
895
    }
896
 
897
    int lastComparison = 0;
898
    LineItem typedOther = (LineItem)other;
899
 
900
    lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
901
    if (lastComparison != 0) {
902
      return lastComparison;
903
    }
904
    lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
905
    if (lastComparison != 0) {
906
      return lastComparison;
907
    }
908
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
909
    if (lastComparison != 0) {
910
      return lastComparison;
911
    }
912
    lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
913
    if (lastComparison != 0) {
914
      return lastComparison;
915
    }
916
    lastComparison = Boolean.valueOf(isSetProductGroup()).compareTo(isSetProductGroup());
917
    if (lastComparison != 0) {
918
      return lastComparison;
919
    }
920
    lastComparison = TBaseHelper.compareTo(productGroup, typedOther.productGroup);
921
    if (lastComparison != 0) {
922
      return lastComparison;
923
    }
924
    lastComparison = Boolean.valueOf(isSetBrand()).compareTo(isSetBrand());
925
    if (lastComparison != 0) {
926
      return lastComparison;
927
    }
928
    lastComparison = TBaseHelper.compareTo(brand, typedOther.brand);
929
    if (lastComparison != 0) {
930
      return lastComparison;
931
    }
932
    lastComparison = Boolean.valueOf(isSetModelNumber()).compareTo(isSetModelNumber());
933
    if (lastComparison != 0) {
934
      return lastComparison;
935
    }
936
    lastComparison = TBaseHelper.compareTo(modelNumber, typedOther.modelNumber);
937
    if (lastComparison != 0) {
938
      return lastComparison;
939
    }
940
    lastComparison = Boolean.valueOf(isSetModelName()).compareTo(isSetModelName());
941
    if (lastComparison != 0) {
942
      return lastComparison;
943
    }
944
    lastComparison = TBaseHelper.compareTo(modelName, typedOther.modelName);
945
    if (lastComparison != 0) {
946
      return lastComparison;
947
    }
948
    lastComparison = Boolean.valueOf(isSetColor()).compareTo(isSetColor());
949
    if (lastComparison != 0) {
950
      return lastComparison;
951
    }
952
    lastComparison = TBaseHelper.compareTo(color, typedOther.color);
953
    if (lastComparison != 0) {
954
      return lastComparison;
955
    }
956
    lastComparison = Boolean.valueOf(isSetItemNumber()).compareTo(isSetItemNumber());
957
    if (lastComparison != 0) {
958
      return lastComparison;
959
    }
960
    lastComparison = TBaseHelper.compareTo(itemNumber, typedOther.itemNumber);
961
    if (lastComparison != 0) {
962
      return lastComparison;
963
    }
964
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(isSetQuantity());
965
    if (lastComparison != 0) {
966
      return lastComparison;
967
    }
968
    lastComparison = TBaseHelper.compareTo(quantity, typedOther.quantity);
969
    if (lastComparison != 0) {
970
      return lastComparison;
971
    }
972
    lastComparison = Boolean.valueOf(isSetUnfulfilledQuantity()).compareTo(isSetUnfulfilledQuantity());
973
    if (lastComparison != 0) {
974
      return lastComparison;
975
    }
976
    lastComparison = TBaseHelper.compareTo(unfulfilledQuantity, typedOther.unfulfilledQuantity);
977
    if (lastComparison != 0) {
978
      return lastComparison;
979
    }
980
    lastComparison = Boolean.valueOf(isSetCreatedAt()).compareTo(isSetCreatedAt());
981
    if (lastComparison != 0) {
982
      return lastComparison;
983
    }
984
    lastComparison = TBaseHelper.compareTo(createdAt, typedOther.createdAt);
985
    if (lastComparison != 0) {
986
      return lastComparison;
987
    }
988
    lastComparison = Boolean.valueOf(isSetUnitPrice()).compareTo(isSetUnitPrice());
989
    if (lastComparison != 0) {
990
      return lastComparison;
991
    }
992
    lastComparison = TBaseHelper.compareTo(unitPrice, typedOther.unitPrice);
993
    if (lastComparison != 0) {
994
      return lastComparison;
995
    }
996
    lastComparison = Boolean.valueOf(isSetFulfilled()).compareTo(isSetFulfilled());
997
    if (lastComparison != 0) {
998
      return lastComparison;
999
    }
1000
    lastComparison = TBaseHelper.compareTo(fulfilled, typedOther.fulfilled);
1001
    if (lastComparison != 0) {
1002
      return lastComparison;
1003
    }
1004
    return 0;
1005
  }
1006
 
1007
  public void read(TProtocol iprot) throws TException {
1008
    TField field;
1009
    iprot.readStructBegin();
1010
    while (true)
1011
    {
1012
      field = iprot.readFieldBegin();
1013
      if (field.type == TType.STOP) { 
1014
        break;
1015
      }
1016
      _Fields fieldId = _Fields.findByThriftId(field.id);
1017
      if (fieldId == null) {
1018
        TProtocolUtil.skip(iprot, field.type);
1019
      } else {
1020
        switch (fieldId) {
1021
          case ORDER_ID:
1022
            if (field.type == TType.I64) {
1023
              this.orderId = iprot.readI64();
1024
              setOrderIdIsSet(true);
1025
            } else { 
1026
              TProtocolUtil.skip(iprot, field.type);
1027
            }
1028
            break;
1029
          case ITEM_ID:
1030
            if (field.type == TType.I64) {
1031
              this.itemId = iprot.readI64();
1032
              setItemIdIsSet(true);
1033
            } else { 
1034
              TProtocolUtil.skip(iprot, field.type);
1035
            }
1036
            break;
1037
          case PRODUCT_GROUP:
1038
            if (field.type == TType.STRING) {
1039
              this.productGroup = iprot.readString();
1040
            } else { 
1041
              TProtocolUtil.skip(iprot, field.type);
1042
            }
1043
            break;
1044
          case BRAND:
1045
            if (field.type == TType.STRING) {
1046
              this.brand = iprot.readString();
1047
            } else { 
1048
              TProtocolUtil.skip(iprot, field.type);
1049
            }
1050
            break;
1051
          case MODEL_NUMBER:
1052
            if (field.type == TType.STRING) {
1053
              this.modelNumber = iprot.readString();
1054
            } else { 
1055
              TProtocolUtil.skip(iprot, field.type);
1056
            }
1057
            break;
1058
          case MODEL_NAME:
1059
            if (field.type == TType.STRING) {
1060
              this.modelName = iprot.readString();
1061
            } else { 
1062
              TProtocolUtil.skip(iprot, field.type);
1063
            }
1064
            break;
1065
          case COLOR:
1066
            if (field.type == TType.STRING) {
1067
              this.color = iprot.readString();
1068
            } else { 
1069
              TProtocolUtil.skip(iprot, field.type);
1070
            }
1071
            break;
1072
          case ITEM_NUMBER:
1073
            if (field.type == TType.STRING) {
1074
              this.itemNumber = iprot.readString();
1075
            } else { 
1076
              TProtocolUtil.skip(iprot, field.type);
1077
            }
1078
            break;
1079
          case QUANTITY:
1080
            if (field.type == TType.DOUBLE) {
1081
              this.quantity = iprot.readDouble();
1082
              setQuantityIsSet(true);
1083
            } else { 
1084
              TProtocolUtil.skip(iprot, field.type);
1085
            }
1086
            break;
1087
          case UNFULFILLED_QUANTITY:
1088
            if (field.type == TType.DOUBLE) {
1089
              this.unfulfilledQuantity = iprot.readDouble();
1090
              setUnfulfilledQuantityIsSet(true);
1091
            } else { 
1092
              TProtocolUtil.skip(iprot, field.type);
1093
            }
1094
            break;
1095
          case CREATED_AT:
1096
            if (field.type == TType.I64) {
1097
              this.createdAt = iprot.readI64();
1098
              setCreatedAtIsSet(true);
1099
            } else { 
1100
              TProtocolUtil.skip(iprot, field.type);
1101
            }
1102
            break;
1103
          case UNIT_PRICE:
1104
            if (field.type == TType.DOUBLE) {
1105
              this.unitPrice = iprot.readDouble();
1106
              setUnitPriceIsSet(true);
1107
            } else { 
1108
              TProtocolUtil.skip(iprot, field.type);
1109
            }
1110
            break;
1111
          case FULFILLED:
1112
            if (field.type == TType.BOOL) {
1113
              this.fulfilled = iprot.readBool();
1114
              setFulfilledIsSet(true);
1115
            } else { 
1116
              TProtocolUtil.skip(iprot, field.type);
1117
            }
1118
            break;
1119
        }
1120
        iprot.readFieldEnd();
1121
      }
1122
    }
1123
    iprot.readStructEnd();
1124
    validate();
1125
  }
1126
 
1127
  public void write(TProtocol oprot) throws TException {
1128
    validate();
1129
 
1130
    oprot.writeStructBegin(STRUCT_DESC);
1131
    oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
1132
    oprot.writeI64(this.orderId);
1133
    oprot.writeFieldEnd();
1134
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
1135
    oprot.writeI64(this.itemId);
1136
    oprot.writeFieldEnd();
1137
    if (this.productGroup != null) {
1138
      oprot.writeFieldBegin(PRODUCT_GROUP_FIELD_DESC);
1139
      oprot.writeString(this.productGroup);
1140
      oprot.writeFieldEnd();
1141
    }
1142
    if (this.brand != null) {
1143
      oprot.writeFieldBegin(BRAND_FIELD_DESC);
1144
      oprot.writeString(this.brand);
1145
      oprot.writeFieldEnd();
1146
    }
1147
    if (this.modelNumber != null) {
1148
      oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
1149
      oprot.writeString(this.modelNumber);
1150
      oprot.writeFieldEnd();
1151
    }
1152
    if (this.modelName != null) {
1153
      oprot.writeFieldBegin(MODEL_NAME_FIELD_DESC);
1154
      oprot.writeString(this.modelName);
1155
      oprot.writeFieldEnd();
1156
    }
1157
    if (this.color != null) {
1158
      oprot.writeFieldBegin(COLOR_FIELD_DESC);
1159
      oprot.writeString(this.color);
1160
      oprot.writeFieldEnd();
1161
    }
1162
    if (this.itemNumber != null) {
1163
      oprot.writeFieldBegin(ITEM_NUMBER_FIELD_DESC);
1164
      oprot.writeString(this.itemNumber);
1165
      oprot.writeFieldEnd();
1166
    }
1167
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
1168
    oprot.writeDouble(this.quantity);
1169
    oprot.writeFieldEnd();
1170
    oprot.writeFieldBegin(UNFULFILLED_QUANTITY_FIELD_DESC);
1171
    oprot.writeDouble(this.unfulfilledQuantity);
1172
    oprot.writeFieldEnd();
1173
    oprot.writeFieldBegin(CREATED_AT_FIELD_DESC);
1174
    oprot.writeI64(this.createdAt);
1175
    oprot.writeFieldEnd();
1176
    oprot.writeFieldBegin(UNIT_PRICE_FIELD_DESC);
1177
    oprot.writeDouble(this.unitPrice);
1178
    oprot.writeFieldEnd();
1179
    oprot.writeFieldBegin(FULFILLED_FIELD_DESC);
1180
    oprot.writeBool(this.fulfilled);
1181
    oprot.writeFieldEnd();
1182
    oprot.writeFieldStop();
1183
    oprot.writeStructEnd();
1184
  }
1185
 
1186
  @Override
1187
  public String toString() {
1188
    StringBuilder sb = new StringBuilder("LineItem(");
1189
    boolean first = true;
1190
 
1191
    sb.append("orderId:");
1192
    sb.append(this.orderId);
1193
    first = false;
1194
    if (!first) sb.append(", ");
1195
    sb.append("itemId:");
1196
    sb.append(this.itemId);
1197
    first = false;
1198
    if (!first) sb.append(", ");
1199
    sb.append("productGroup:");
1200
    if (this.productGroup == null) {
1201
      sb.append("null");
1202
    } else {
1203
      sb.append(this.productGroup);
1204
    }
1205
    first = false;
1206
    if (!first) sb.append(", ");
1207
    sb.append("brand:");
1208
    if (this.brand == null) {
1209
      sb.append("null");
1210
    } else {
1211
      sb.append(this.brand);
1212
    }
1213
    first = false;
1214
    if (!first) sb.append(", ");
1215
    sb.append("modelNumber:");
1216
    if (this.modelNumber == null) {
1217
      sb.append("null");
1218
    } else {
1219
      sb.append(this.modelNumber);
1220
    }
1221
    first = false;
1222
    if (!first) sb.append(", ");
1223
    sb.append("modelName:");
1224
    if (this.modelName == null) {
1225
      sb.append("null");
1226
    } else {
1227
      sb.append(this.modelName);
1228
    }
1229
    first = false;
1230
    if (!first) sb.append(", ");
1231
    sb.append("color:");
1232
    if (this.color == null) {
1233
      sb.append("null");
1234
    } else {
1235
      sb.append(this.color);
1236
    }
1237
    first = false;
1238
    if (!first) sb.append(", ");
1239
    sb.append("itemNumber:");
1240
    if (this.itemNumber == null) {
1241
      sb.append("null");
1242
    } else {
1243
      sb.append(this.itemNumber);
1244
    }
1245
    first = false;
1246
    if (!first) sb.append(", ");
1247
    sb.append("quantity:");
1248
    sb.append(this.quantity);
1249
    first = false;
1250
    if (!first) sb.append(", ");
1251
    sb.append("unfulfilledQuantity:");
1252
    sb.append(this.unfulfilledQuantity);
1253
    first = false;
1254
    if (!first) sb.append(", ");
1255
    sb.append("createdAt:");
1256
    sb.append(this.createdAt);
1257
    first = false;
1258
    if (!first) sb.append(", ");
1259
    sb.append("unitPrice:");
1260
    sb.append(this.unitPrice);
1261
    first = false;
1262
    if (!first) sb.append(", ");
1263
    sb.append("fulfilled:");
1264
    sb.append(this.fulfilled);
1265
    first = false;
1266
    sb.append(")");
1267
    return sb.toString();
1268
  }
1269
 
1270
  public void validate() throws TException {
1271
    // check for required fields
1272
  }
1273
 
1274
}
1275