Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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