Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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