Subversion Repositories SmartDukaan

Rev

Rev 8363 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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