Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
5711 mandeep.dh 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.warehouse;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class InventoryAge implements org.apache.thrift.TBase<InventoryAge, InventoryAge._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InventoryAge");
25
 
26
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField BRAND_FIELD_DESC = new org.apache.thrift.protocol.TField("brand", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField MODEL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("modelName", org.apache.thrift.protocol.TType.STRING, (short)3);
29
  private static final org.apache.thrift.protocol.TField MODEL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("modelNumber", org.apache.thrift.protocol.TType.STRING, (short)4);
30
  private static final org.apache.thrift.protocol.TField COLOR_FIELD_DESC = new org.apache.thrift.protocol.TField("color", org.apache.thrift.protocol.TType.STRING, (short)5);
31
  private static final org.apache.thrift.protocol.TField FRESH_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("freshCount", org.apache.thrift.protocol.TType.I64, (short)6);
32
  private static final org.apache.thrift.protocol.TField ONE_TO_TWO_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("oneToTwoCount", org.apache.thrift.protocol.TType.I64, (short)7);
33
  private static final org.apache.thrift.protocol.TField TWO_TO_THREE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("TwoToThreeCount", org.apache.thrift.protocol.TType.I64, (short)8);
34
  private static final org.apache.thrift.protocol.TField THREE_TO_FOUR_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("ThreeToFourCount", org.apache.thrift.protocol.TType.I64, (short)9);
35
  private static final org.apache.thrift.protocol.TField FOUR_PLUS_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("FourPlusCount", org.apache.thrift.protocol.TType.I64, (short)10);
36
 
37
  private long itemId; // required
38
  private String brand; // required
39
  private String modelName; // required
40
  private String modelNumber; // required
41
  private String color; // required
42
  private long freshCount; // required
43
  private long oneToTwoCount; // required
44
  private long TwoToThreeCount; // required
45
  private long ThreeToFourCount; // required
46
  private long FourPlusCount; // required
47
 
48
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
49
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
50
    ITEM_ID((short)1, "itemId"),
51
    BRAND((short)2, "brand"),
52
    MODEL_NAME((short)3, "modelName"),
53
    MODEL_NUMBER((short)4, "modelNumber"),
54
    COLOR((short)5, "color"),
55
    FRESH_COUNT((short)6, "freshCount"),
56
    ONE_TO_TWO_COUNT((short)7, "oneToTwoCount"),
57
    TWO_TO_THREE_COUNT((short)8, "TwoToThreeCount"),
58
    THREE_TO_FOUR_COUNT((short)9, "ThreeToFourCount"),
59
    FOUR_PLUS_COUNT((short)10, "FourPlusCount");
60
 
61
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
62
 
63
    static {
64
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
65
        byName.put(field.getFieldName(), field);
66
      }
67
    }
68
 
69
    /**
70
     * Find the _Fields constant that matches fieldId, or null if its not found.
71
     */
72
    public static _Fields findByThriftId(int fieldId) {
73
      switch(fieldId) {
74
        case 1: // ITEM_ID
75
          return ITEM_ID;
76
        case 2: // BRAND
77
          return BRAND;
78
        case 3: // MODEL_NAME
79
          return MODEL_NAME;
80
        case 4: // MODEL_NUMBER
81
          return MODEL_NUMBER;
82
        case 5: // COLOR
83
          return COLOR;
84
        case 6: // FRESH_COUNT
85
          return FRESH_COUNT;
86
        case 7: // ONE_TO_TWO_COUNT
87
          return ONE_TO_TWO_COUNT;
88
        case 8: // TWO_TO_THREE_COUNT
89
          return TWO_TO_THREE_COUNT;
90
        case 9: // THREE_TO_FOUR_COUNT
91
          return THREE_TO_FOUR_COUNT;
92
        case 10: // FOUR_PLUS_COUNT
93
          return FOUR_PLUS_COUNT;
94
        default:
95
          return null;
96
      }
97
    }
98
 
99
    /**
100
     * Find the _Fields constant that matches fieldId, throwing an exception
101
     * if it is not found.
102
     */
103
    public static _Fields findByThriftIdOrThrow(int fieldId) {
104
      _Fields fields = findByThriftId(fieldId);
105
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
106
      return fields;
107
    }
108
 
109
    /**
110
     * Find the _Fields constant that matches name, or null if its not found.
111
     */
112
    public static _Fields findByName(String name) {
113
      return byName.get(name);
114
    }
115
 
116
    private final short _thriftId;
117
    private final String _fieldName;
118
 
119
    _Fields(short thriftId, String fieldName) {
120
      _thriftId = thriftId;
121
      _fieldName = fieldName;
122
    }
123
 
124
    public short getThriftFieldId() {
125
      return _thriftId;
126
    }
127
 
128
    public String getFieldName() {
129
      return _fieldName;
130
    }
131
  }
132
 
133
  // isset id assignments
134
  private static final int __ITEMID_ISSET_ID = 0;
135
  private static final int __FRESHCOUNT_ISSET_ID = 1;
136
  private static final int __ONETOTWOCOUNT_ISSET_ID = 2;
137
  private static final int __TWOTOTHREECOUNT_ISSET_ID = 3;
138
  private static final int __THREETOFOURCOUNT_ISSET_ID = 4;
139
  private static final int __FOURPLUSCOUNT_ISSET_ID = 5;
140
  private BitSet __isset_bit_vector = new BitSet(6);
141
 
142
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
143
  static {
144
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
145
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
147
    tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
149
    tmpMap.put(_Fields.MODEL_NAME, new org.apache.thrift.meta_data.FieldMetaData("modelName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
151
    tmpMap.put(_Fields.MODEL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("modelNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
153
    tmpMap.put(_Fields.COLOR, new org.apache.thrift.meta_data.FieldMetaData("color", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
155
    tmpMap.put(_Fields.FRESH_COUNT, new org.apache.thrift.meta_data.FieldMetaData("freshCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
157
    tmpMap.put(_Fields.ONE_TO_TWO_COUNT, new org.apache.thrift.meta_data.FieldMetaData("oneToTwoCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
159
    tmpMap.put(_Fields.TWO_TO_THREE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("TwoToThreeCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
160
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
161
    tmpMap.put(_Fields.THREE_TO_FOUR_COUNT, new org.apache.thrift.meta_data.FieldMetaData("ThreeToFourCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
162
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
163
    tmpMap.put(_Fields.FOUR_PLUS_COUNT, new org.apache.thrift.meta_data.FieldMetaData("FourPlusCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
164
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
165
    metaDataMap = Collections.unmodifiableMap(tmpMap);
166
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InventoryAge.class, metaDataMap);
167
  }
168
 
169
  public InventoryAge() {
170
  }
171
 
172
  public InventoryAge(
173
    long itemId,
174
    String brand,
175
    String modelName,
176
    String modelNumber,
177
    String color,
178
    long freshCount,
179
    long oneToTwoCount,
180
    long TwoToThreeCount,
181
    long ThreeToFourCount,
182
    long FourPlusCount)
183
  {
184
    this();
185
    this.itemId = itemId;
186
    setItemIdIsSet(true);
187
    this.brand = brand;
188
    this.modelName = modelName;
189
    this.modelNumber = modelNumber;
190
    this.color = color;
191
    this.freshCount = freshCount;
192
    setFreshCountIsSet(true);
193
    this.oneToTwoCount = oneToTwoCount;
194
    setOneToTwoCountIsSet(true);
195
    this.TwoToThreeCount = TwoToThreeCount;
196
    setTwoToThreeCountIsSet(true);
197
    this.ThreeToFourCount = ThreeToFourCount;
198
    setThreeToFourCountIsSet(true);
199
    this.FourPlusCount = FourPlusCount;
200
    setFourPlusCountIsSet(true);
201
  }
202
 
203
  /**
204
   * Performs a deep copy on <i>other</i>.
205
   */
206
  public InventoryAge(InventoryAge other) {
207
    __isset_bit_vector.clear();
208
    __isset_bit_vector.or(other.__isset_bit_vector);
209
    this.itemId = other.itemId;
210
    if (other.isSetBrand()) {
211
      this.brand = other.brand;
212
    }
213
    if (other.isSetModelName()) {
214
      this.modelName = other.modelName;
215
    }
216
    if (other.isSetModelNumber()) {
217
      this.modelNumber = other.modelNumber;
218
    }
219
    if (other.isSetColor()) {
220
      this.color = other.color;
221
    }
222
    this.freshCount = other.freshCount;
223
    this.oneToTwoCount = other.oneToTwoCount;
224
    this.TwoToThreeCount = other.TwoToThreeCount;
225
    this.ThreeToFourCount = other.ThreeToFourCount;
226
    this.FourPlusCount = other.FourPlusCount;
227
  }
228
 
229
  public InventoryAge deepCopy() {
230
    return new InventoryAge(this);
231
  }
232
 
233
  @Override
234
  public void clear() {
235
    setItemIdIsSet(false);
236
    this.itemId = 0;
237
    this.brand = null;
238
    this.modelName = null;
239
    this.modelNumber = null;
240
    this.color = null;
241
    setFreshCountIsSet(false);
242
    this.freshCount = 0;
243
    setOneToTwoCountIsSet(false);
244
    this.oneToTwoCount = 0;
245
    setTwoToThreeCountIsSet(false);
246
    this.TwoToThreeCount = 0;
247
    setThreeToFourCountIsSet(false);
248
    this.ThreeToFourCount = 0;
249
    setFourPlusCountIsSet(false);
250
    this.FourPlusCount = 0;
251
  }
252
 
253
  public long getItemId() {
254
    return this.itemId;
255
  }
256
 
257
  public void setItemId(long itemId) {
258
    this.itemId = itemId;
259
    setItemIdIsSet(true);
260
  }
261
 
262
  public void unsetItemId() {
263
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
264
  }
265
 
266
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
267
  public boolean isSetItemId() {
268
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
269
  }
270
 
271
  public void setItemIdIsSet(boolean value) {
272
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
273
  }
274
 
275
  public String getBrand() {
276
    return this.brand;
277
  }
278
 
279
  public void setBrand(String brand) {
280
    this.brand = brand;
281
  }
282
 
283
  public void unsetBrand() {
284
    this.brand = null;
285
  }
286
 
287
  /** Returns true if field brand is set (has been assigned a value) and false otherwise */
288
  public boolean isSetBrand() {
289
    return this.brand != null;
290
  }
291
 
292
  public void setBrandIsSet(boolean value) {
293
    if (!value) {
294
      this.brand = null;
295
    }
296
  }
297
 
298
  public String getModelName() {
299
    return this.modelName;
300
  }
301
 
302
  public void setModelName(String modelName) {
303
    this.modelName = modelName;
304
  }
305
 
306
  public void unsetModelName() {
307
    this.modelName = null;
308
  }
309
 
310
  /** Returns true if field modelName is set (has been assigned a value) and false otherwise */
311
  public boolean isSetModelName() {
312
    return this.modelName != null;
313
  }
314
 
315
  public void setModelNameIsSet(boolean value) {
316
    if (!value) {
317
      this.modelName = null;
318
    }
319
  }
320
 
321
  public String getModelNumber() {
322
    return this.modelNumber;
323
  }
324
 
325
  public void setModelNumber(String modelNumber) {
326
    this.modelNumber = modelNumber;
327
  }
328
 
329
  public void unsetModelNumber() {
330
    this.modelNumber = null;
331
  }
332
 
333
  /** Returns true if field modelNumber is set (has been assigned a value) and false otherwise */
334
  public boolean isSetModelNumber() {
335
    return this.modelNumber != null;
336
  }
337
 
338
  public void setModelNumberIsSet(boolean value) {
339
    if (!value) {
340
      this.modelNumber = null;
341
    }
342
  }
343
 
344
  public String getColor() {
345
    return this.color;
346
  }
347
 
348
  public void setColor(String color) {
349
    this.color = color;
350
  }
351
 
352
  public void unsetColor() {
353
    this.color = null;
354
  }
355
 
356
  /** Returns true if field color is set (has been assigned a value) and false otherwise */
357
  public boolean isSetColor() {
358
    return this.color != null;
359
  }
360
 
361
  public void setColorIsSet(boolean value) {
362
    if (!value) {
363
      this.color = null;
364
    }
365
  }
366
 
367
  public long getFreshCount() {
368
    return this.freshCount;
369
  }
370
 
371
  public void setFreshCount(long freshCount) {
372
    this.freshCount = freshCount;
373
    setFreshCountIsSet(true);
374
  }
375
 
376
  public void unsetFreshCount() {
377
    __isset_bit_vector.clear(__FRESHCOUNT_ISSET_ID);
378
  }
379
 
380
  /** Returns true if field freshCount is set (has been assigned a value) and false otherwise */
381
  public boolean isSetFreshCount() {
382
    return __isset_bit_vector.get(__FRESHCOUNT_ISSET_ID);
383
  }
384
 
385
  public void setFreshCountIsSet(boolean value) {
386
    __isset_bit_vector.set(__FRESHCOUNT_ISSET_ID, value);
387
  }
388
 
389
  public long getOneToTwoCount() {
390
    return this.oneToTwoCount;
391
  }
392
 
393
  public void setOneToTwoCount(long oneToTwoCount) {
394
    this.oneToTwoCount = oneToTwoCount;
395
    setOneToTwoCountIsSet(true);
396
  }
397
 
398
  public void unsetOneToTwoCount() {
399
    __isset_bit_vector.clear(__ONETOTWOCOUNT_ISSET_ID);
400
  }
401
 
402
  /** Returns true if field oneToTwoCount is set (has been assigned a value) and false otherwise */
403
  public boolean isSetOneToTwoCount() {
404
    return __isset_bit_vector.get(__ONETOTWOCOUNT_ISSET_ID);
405
  }
406
 
407
  public void setOneToTwoCountIsSet(boolean value) {
408
    __isset_bit_vector.set(__ONETOTWOCOUNT_ISSET_ID, value);
409
  }
410
 
411
  public long getTwoToThreeCount() {
412
    return this.TwoToThreeCount;
413
  }
414
 
415
  public void setTwoToThreeCount(long TwoToThreeCount) {
416
    this.TwoToThreeCount = TwoToThreeCount;
417
    setTwoToThreeCountIsSet(true);
418
  }
419
 
420
  public void unsetTwoToThreeCount() {
421
    __isset_bit_vector.clear(__TWOTOTHREECOUNT_ISSET_ID);
422
  }
423
 
424
  /** Returns true if field TwoToThreeCount is set (has been assigned a value) and false otherwise */
425
  public boolean isSetTwoToThreeCount() {
426
    return __isset_bit_vector.get(__TWOTOTHREECOUNT_ISSET_ID);
427
  }
428
 
429
  public void setTwoToThreeCountIsSet(boolean value) {
430
    __isset_bit_vector.set(__TWOTOTHREECOUNT_ISSET_ID, value);
431
  }
432
 
433
  public long getThreeToFourCount() {
434
    return this.ThreeToFourCount;
435
  }
436
 
437
  public void setThreeToFourCount(long ThreeToFourCount) {
438
    this.ThreeToFourCount = ThreeToFourCount;
439
    setThreeToFourCountIsSet(true);
440
  }
441
 
442
  public void unsetThreeToFourCount() {
443
    __isset_bit_vector.clear(__THREETOFOURCOUNT_ISSET_ID);
444
  }
445
 
446
  /** Returns true if field ThreeToFourCount is set (has been assigned a value) and false otherwise */
447
  public boolean isSetThreeToFourCount() {
448
    return __isset_bit_vector.get(__THREETOFOURCOUNT_ISSET_ID);
449
  }
450
 
451
  public void setThreeToFourCountIsSet(boolean value) {
452
    __isset_bit_vector.set(__THREETOFOURCOUNT_ISSET_ID, value);
453
  }
454
 
455
  public long getFourPlusCount() {
456
    return this.FourPlusCount;
457
  }
458
 
459
  public void setFourPlusCount(long FourPlusCount) {
460
    this.FourPlusCount = FourPlusCount;
461
    setFourPlusCountIsSet(true);
462
  }
463
 
464
  public void unsetFourPlusCount() {
465
    __isset_bit_vector.clear(__FOURPLUSCOUNT_ISSET_ID);
466
  }
467
 
468
  /** Returns true if field FourPlusCount is set (has been assigned a value) and false otherwise */
469
  public boolean isSetFourPlusCount() {
470
    return __isset_bit_vector.get(__FOURPLUSCOUNT_ISSET_ID);
471
  }
472
 
473
  public void setFourPlusCountIsSet(boolean value) {
474
    __isset_bit_vector.set(__FOURPLUSCOUNT_ISSET_ID, value);
475
  }
476
 
477
  public void setFieldValue(_Fields field, Object value) {
478
    switch (field) {
479
    case ITEM_ID:
480
      if (value == null) {
481
        unsetItemId();
482
      } else {
483
        setItemId((Long)value);
484
      }
485
      break;
486
 
487
    case BRAND:
488
      if (value == null) {
489
        unsetBrand();
490
      } else {
491
        setBrand((String)value);
492
      }
493
      break;
494
 
495
    case MODEL_NAME:
496
      if (value == null) {
497
        unsetModelName();
498
      } else {
499
        setModelName((String)value);
500
      }
501
      break;
502
 
503
    case MODEL_NUMBER:
504
      if (value == null) {
505
        unsetModelNumber();
506
      } else {
507
        setModelNumber((String)value);
508
      }
509
      break;
510
 
511
    case COLOR:
512
      if (value == null) {
513
        unsetColor();
514
      } else {
515
        setColor((String)value);
516
      }
517
      break;
518
 
519
    case FRESH_COUNT:
520
      if (value == null) {
521
        unsetFreshCount();
522
      } else {
523
        setFreshCount((Long)value);
524
      }
525
      break;
526
 
527
    case ONE_TO_TWO_COUNT:
528
      if (value == null) {
529
        unsetOneToTwoCount();
530
      } else {
531
        setOneToTwoCount((Long)value);
532
      }
533
      break;
534
 
535
    case TWO_TO_THREE_COUNT:
536
      if (value == null) {
537
        unsetTwoToThreeCount();
538
      } else {
539
        setTwoToThreeCount((Long)value);
540
      }
541
      break;
542
 
543
    case THREE_TO_FOUR_COUNT:
544
      if (value == null) {
545
        unsetThreeToFourCount();
546
      } else {
547
        setThreeToFourCount((Long)value);
548
      }
549
      break;
550
 
551
    case FOUR_PLUS_COUNT:
552
      if (value == null) {
553
        unsetFourPlusCount();
554
      } else {
555
        setFourPlusCount((Long)value);
556
      }
557
      break;
558
 
559
    }
560
  }
561
 
562
  public Object getFieldValue(_Fields field) {
563
    switch (field) {
564
    case ITEM_ID:
565
      return Long.valueOf(getItemId());
566
 
567
    case BRAND:
568
      return getBrand();
569
 
570
    case MODEL_NAME:
571
      return getModelName();
572
 
573
    case MODEL_NUMBER:
574
      return getModelNumber();
575
 
576
    case COLOR:
577
      return getColor();
578
 
579
    case FRESH_COUNT:
580
      return Long.valueOf(getFreshCount());
581
 
582
    case ONE_TO_TWO_COUNT:
583
      return Long.valueOf(getOneToTwoCount());
584
 
585
    case TWO_TO_THREE_COUNT:
586
      return Long.valueOf(getTwoToThreeCount());
587
 
588
    case THREE_TO_FOUR_COUNT:
589
      return Long.valueOf(getThreeToFourCount());
590
 
591
    case FOUR_PLUS_COUNT:
592
      return Long.valueOf(getFourPlusCount());
593
 
594
    }
595
    throw new IllegalStateException();
596
  }
597
 
598
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
599
  public boolean isSet(_Fields field) {
600
    if (field == null) {
601
      throw new IllegalArgumentException();
602
    }
603
 
604
    switch (field) {
605
    case ITEM_ID:
606
      return isSetItemId();
607
    case BRAND:
608
      return isSetBrand();
609
    case MODEL_NAME:
610
      return isSetModelName();
611
    case MODEL_NUMBER:
612
      return isSetModelNumber();
613
    case COLOR:
614
      return isSetColor();
615
    case FRESH_COUNT:
616
      return isSetFreshCount();
617
    case ONE_TO_TWO_COUNT:
618
      return isSetOneToTwoCount();
619
    case TWO_TO_THREE_COUNT:
620
      return isSetTwoToThreeCount();
621
    case THREE_TO_FOUR_COUNT:
622
      return isSetThreeToFourCount();
623
    case FOUR_PLUS_COUNT:
624
      return isSetFourPlusCount();
625
    }
626
    throw new IllegalStateException();
627
  }
628
 
629
  @Override
630
  public boolean equals(Object that) {
631
    if (that == null)
632
      return false;
633
    if (that instanceof InventoryAge)
634
      return this.equals((InventoryAge)that);
635
    return false;
636
  }
637
 
638
  public boolean equals(InventoryAge that) {
639
    if (that == null)
640
      return false;
641
 
642
    boolean this_present_itemId = true;
643
    boolean that_present_itemId = true;
644
    if (this_present_itemId || that_present_itemId) {
645
      if (!(this_present_itemId && that_present_itemId))
646
        return false;
647
      if (this.itemId != that.itemId)
648
        return false;
649
    }
650
 
651
    boolean this_present_brand = true && this.isSetBrand();
652
    boolean that_present_brand = true && that.isSetBrand();
653
    if (this_present_brand || that_present_brand) {
654
      if (!(this_present_brand && that_present_brand))
655
        return false;
656
      if (!this.brand.equals(that.brand))
657
        return false;
658
    }
659
 
660
    boolean this_present_modelName = true && this.isSetModelName();
661
    boolean that_present_modelName = true && that.isSetModelName();
662
    if (this_present_modelName || that_present_modelName) {
663
      if (!(this_present_modelName && that_present_modelName))
664
        return false;
665
      if (!this.modelName.equals(that.modelName))
666
        return false;
667
    }
668
 
669
    boolean this_present_modelNumber = true && this.isSetModelNumber();
670
    boolean that_present_modelNumber = true && that.isSetModelNumber();
671
    if (this_present_modelNumber || that_present_modelNumber) {
672
      if (!(this_present_modelNumber && that_present_modelNumber))
673
        return false;
674
      if (!this.modelNumber.equals(that.modelNumber))
675
        return false;
676
    }
677
 
678
    boolean this_present_color = true && this.isSetColor();
679
    boolean that_present_color = true && that.isSetColor();
680
    if (this_present_color || that_present_color) {
681
      if (!(this_present_color && that_present_color))
682
        return false;
683
      if (!this.color.equals(that.color))
684
        return false;
685
    }
686
 
687
    boolean this_present_freshCount = true;
688
    boolean that_present_freshCount = true;
689
    if (this_present_freshCount || that_present_freshCount) {
690
      if (!(this_present_freshCount && that_present_freshCount))
691
        return false;
692
      if (this.freshCount != that.freshCount)
693
        return false;
694
    }
695
 
696
    boolean this_present_oneToTwoCount = true;
697
    boolean that_present_oneToTwoCount = true;
698
    if (this_present_oneToTwoCount || that_present_oneToTwoCount) {
699
      if (!(this_present_oneToTwoCount && that_present_oneToTwoCount))
700
        return false;
701
      if (this.oneToTwoCount != that.oneToTwoCount)
702
        return false;
703
    }
704
 
705
    boolean this_present_TwoToThreeCount = true;
706
    boolean that_present_TwoToThreeCount = true;
707
    if (this_present_TwoToThreeCount || that_present_TwoToThreeCount) {
708
      if (!(this_present_TwoToThreeCount && that_present_TwoToThreeCount))
709
        return false;
710
      if (this.TwoToThreeCount != that.TwoToThreeCount)
711
        return false;
712
    }
713
 
714
    boolean this_present_ThreeToFourCount = true;
715
    boolean that_present_ThreeToFourCount = true;
716
    if (this_present_ThreeToFourCount || that_present_ThreeToFourCount) {
717
      if (!(this_present_ThreeToFourCount && that_present_ThreeToFourCount))
718
        return false;
719
      if (this.ThreeToFourCount != that.ThreeToFourCount)
720
        return false;
721
    }
722
 
723
    boolean this_present_FourPlusCount = true;
724
    boolean that_present_FourPlusCount = true;
725
    if (this_present_FourPlusCount || that_present_FourPlusCount) {
726
      if (!(this_present_FourPlusCount && that_present_FourPlusCount))
727
        return false;
728
      if (this.FourPlusCount != that.FourPlusCount)
729
        return false;
730
    }
731
 
732
    return true;
733
  }
734
 
735
  @Override
736
  public int hashCode() {
737
    return 0;
738
  }
739
 
740
  public int compareTo(InventoryAge other) {
741
    if (!getClass().equals(other.getClass())) {
742
      return getClass().getName().compareTo(other.getClass().getName());
743
    }
744
 
745
    int lastComparison = 0;
746
    InventoryAge typedOther = (InventoryAge)other;
747
 
748
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
749
    if (lastComparison != 0) {
750
      return lastComparison;
751
    }
752
    if (isSetItemId()) {
753
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
754
      if (lastComparison != 0) {
755
        return lastComparison;
756
      }
757
    }
758
    lastComparison = Boolean.valueOf(isSetBrand()).compareTo(typedOther.isSetBrand());
759
    if (lastComparison != 0) {
760
      return lastComparison;
761
    }
762
    if (isSetBrand()) {
763
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
764
      if (lastComparison != 0) {
765
        return lastComparison;
766
      }
767
    }
768
    lastComparison = Boolean.valueOf(isSetModelName()).compareTo(typedOther.isSetModelName());
769
    if (lastComparison != 0) {
770
      return lastComparison;
771
    }
772
    if (isSetModelName()) {
773
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelName, typedOther.modelName);
774
      if (lastComparison != 0) {
775
        return lastComparison;
776
      }
777
    }
778
    lastComparison = Boolean.valueOf(isSetModelNumber()).compareTo(typedOther.isSetModelNumber());
779
    if (lastComparison != 0) {
780
      return lastComparison;
781
    }
782
    if (isSetModelNumber()) {
783
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelNumber, typedOther.modelNumber);
784
      if (lastComparison != 0) {
785
        return lastComparison;
786
      }
787
    }
788
    lastComparison = Boolean.valueOf(isSetColor()).compareTo(typedOther.isSetColor());
789
    if (lastComparison != 0) {
790
      return lastComparison;
791
    }
792
    if (isSetColor()) {
793
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.color, typedOther.color);
794
      if (lastComparison != 0) {
795
        return lastComparison;
796
      }
797
    }
798
    lastComparison = Boolean.valueOf(isSetFreshCount()).compareTo(typedOther.isSetFreshCount());
799
    if (lastComparison != 0) {
800
      return lastComparison;
801
    }
802
    if (isSetFreshCount()) {
803
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freshCount, typedOther.freshCount);
804
      if (lastComparison != 0) {
805
        return lastComparison;
806
      }
807
    }
808
    lastComparison = Boolean.valueOf(isSetOneToTwoCount()).compareTo(typedOther.isSetOneToTwoCount());
809
    if (lastComparison != 0) {
810
      return lastComparison;
811
    }
812
    if (isSetOneToTwoCount()) {
813
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.oneToTwoCount, typedOther.oneToTwoCount);
814
      if (lastComparison != 0) {
815
        return lastComparison;
816
      }
817
    }
818
    lastComparison = Boolean.valueOf(isSetTwoToThreeCount()).compareTo(typedOther.isSetTwoToThreeCount());
819
    if (lastComparison != 0) {
820
      return lastComparison;
821
    }
822
    if (isSetTwoToThreeCount()) {
823
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.TwoToThreeCount, typedOther.TwoToThreeCount);
824
      if (lastComparison != 0) {
825
        return lastComparison;
826
      }
827
    }
828
    lastComparison = Boolean.valueOf(isSetThreeToFourCount()).compareTo(typedOther.isSetThreeToFourCount());
829
    if (lastComparison != 0) {
830
      return lastComparison;
831
    }
832
    if (isSetThreeToFourCount()) {
833
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ThreeToFourCount, typedOther.ThreeToFourCount);
834
      if (lastComparison != 0) {
835
        return lastComparison;
836
      }
837
    }
838
    lastComparison = Boolean.valueOf(isSetFourPlusCount()).compareTo(typedOther.isSetFourPlusCount());
839
    if (lastComparison != 0) {
840
      return lastComparison;
841
    }
842
    if (isSetFourPlusCount()) {
843
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.FourPlusCount, typedOther.FourPlusCount);
844
      if (lastComparison != 0) {
845
        return lastComparison;
846
      }
847
    }
848
    return 0;
849
  }
850
 
851
  public _Fields fieldForId(int fieldId) {
852
    return _Fields.findByThriftId(fieldId);
853
  }
854
 
855
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
856
    org.apache.thrift.protocol.TField field;
857
    iprot.readStructBegin();
858
    while (true)
859
    {
860
      field = iprot.readFieldBegin();
861
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
862
        break;
863
      }
864
      switch (field.id) {
865
        case 1: // ITEM_ID
866
          if (field.type == org.apache.thrift.protocol.TType.I64) {
867
            this.itemId = iprot.readI64();
868
            setItemIdIsSet(true);
869
          } else { 
870
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
871
          }
872
          break;
873
        case 2: // BRAND
874
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
875
            this.brand = iprot.readString();
876
          } else { 
877
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
878
          }
879
          break;
880
        case 3: // MODEL_NAME
881
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
882
            this.modelName = iprot.readString();
883
          } else { 
884
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
885
          }
886
          break;
887
        case 4: // MODEL_NUMBER
888
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
889
            this.modelNumber = iprot.readString();
890
          } else { 
891
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
892
          }
893
          break;
894
        case 5: // COLOR
895
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
896
            this.color = iprot.readString();
897
          } else { 
898
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
899
          }
900
          break;
901
        case 6: // FRESH_COUNT
902
          if (field.type == org.apache.thrift.protocol.TType.I64) {
903
            this.freshCount = iprot.readI64();
904
            setFreshCountIsSet(true);
905
          } else { 
906
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
907
          }
908
          break;
909
        case 7: // ONE_TO_TWO_COUNT
910
          if (field.type == org.apache.thrift.protocol.TType.I64) {
911
            this.oneToTwoCount = iprot.readI64();
912
            setOneToTwoCountIsSet(true);
913
          } else { 
914
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
915
          }
916
          break;
917
        case 8: // TWO_TO_THREE_COUNT
918
          if (field.type == org.apache.thrift.protocol.TType.I64) {
919
            this.TwoToThreeCount = iprot.readI64();
920
            setTwoToThreeCountIsSet(true);
921
          } else { 
922
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
923
          }
924
          break;
925
        case 9: // THREE_TO_FOUR_COUNT
926
          if (field.type == org.apache.thrift.protocol.TType.I64) {
927
            this.ThreeToFourCount = iprot.readI64();
928
            setThreeToFourCountIsSet(true);
929
          } else { 
930
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
931
          }
932
          break;
933
        case 10: // FOUR_PLUS_COUNT
934
          if (field.type == org.apache.thrift.protocol.TType.I64) {
935
            this.FourPlusCount = iprot.readI64();
936
            setFourPlusCountIsSet(true);
937
          } else { 
938
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
939
          }
940
          break;
941
        default:
942
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
943
      }
944
      iprot.readFieldEnd();
945
    }
946
    iprot.readStructEnd();
947
    validate();
948
  }
949
 
950
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
951
    validate();
952
 
953
    oprot.writeStructBegin(STRUCT_DESC);
954
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
955
    oprot.writeI64(this.itemId);
956
    oprot.writeFieldEnd();
957
    if (this.brand != null) {
958
      oprot.writeFieldBegin(BRAND_FIELD_DESC);
959
      oprot.writeString(this.brand);
960
      oprot.writeFieldEnd();
961
    }
962
    if (this.modelName != null) {
963
      oprot.writeFieldBegin(MODEL_NAME_FIELD_DESC);
964
      oprot.writeString(this.modelName);
965
      oprot.writeFieldEnd();
966
    }
967
    if (this.modelNumber != null) {
968
      oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
969
      oprot.writeString(this.modelNumber);
970
      oprot.writeFieldEnd();
971
    }
972
    if (this.color != null) {
973
      oprot.writeFieldBegin(COLOR_FIELD_DESC);
974
      oprot.writeString(this.color);
975
      oprot.writeFieldEnd();
976
    }
977
    oprot.writeFieldBegin(FRESH_COUNT_FIELD_DESC);
978
    oprot.writeI64(this.freshCount);
979
    oprot.writeFieldEnd();
980
    oprot.writeFieldBegin(ONE_TO_TWO_COUNT_FIELD_DESC);
981
    oprot.writeI64(this.oneToTwoCount);
982
    oprot.writeFieldEnd();
983
    oprot.writeFieldBegin(TWO_TO_THREE_COUNT_FIELD_DESC);
984
    oprot.writeI64(this.TwoToThreeCount);
985
    oprot.writeFieldEnd();
986
    oprot.writeFieldBegin(THREE_TO_FOUR_COUNT_FIELD_DESC);
987
    oprot.writeI64(this.ThreeToFourCount);
988
    oprot.writeFieldEnd();
989
    oprot.writeFieldBegin(FOUR_PLUS_COUNT_FIELD_DESC);
990
    oprot.writeI64(this.FourPlusCount);
991
    oprot.writeFieldEnd();
992
    oprot.writeFieldStop();
993
    oprot.writeStructEnd();
994
  }
995
 
996
  @Override
997
  public String toString() {
998
    StringBuilder sb = new StringBuilder("InventoryAge(");
999
    boolean first = true;
1000
 
1001
    sb.append("itemId:");
1002
    sb.append(this.itemId);
1003
    first = false;
1004
    if (!first) sb.append(", ");
1005
    sb.append("brand:");
1006
    if (this.brand == null) {
1007
      sb.append("null");
1008
    } else {
1009
      sb.append(this.brand);
1010
    }
1011
    first = false;
1012
    if (!first) sb.append(", ");
1013
    sb.append("modelName:");
1014
    if (this.modelName == null) {
1015
      sb.append("null");
1016
    } else {
1017
      sb.append(this.modelName);
1018
    }
1019
    first = false;
1020
    if (!first) sb.append(", ");
1021
    sb.append("modelNumber:");
1022
    if (this.modelNumber == null) {
1023
      sb.append("null");
1024
    } else {
1025
      sb.append(this.modelNumber);
1026
    }
1027
    first = false;
1028
    if (!first) sb.append(", ");
1029
    sb.append("color:");
1030
    if (this.color == null) {
1031
      sb.append("null");
1032
    } else {
1033
      sb.append(this.color);
1034
    }
1035
    first = false;
1036
    if (!first) sb.append(", ");
1037
    sb.append("freshCount:");
1038
    sb.append(this.freshCount);
1039
    first = false;
1040
    if (!first) sb.append(", ");
1041
    sb.append("oneToTwoCount:");
1042
    sb.append(this.oneToTwoCount);
1043
    first = false;
1044
    if (!first) sb.append(", ");
1045
    sb.append("TwoToThreeCount:");
1046
    sb.append(this.TwoToThreeCount);
1047
    first = false;
1048
    if (!first) sb.append(", ");
1049
    sb.append("ThreeToFourCount:");
1050
    sb.append(this.ThreeToFourCount);
1051
    first = false;
1052
    if (!first) sb.append(", ");
1053
    sb.append("FourPlusCount:");
1054
    sb.append(this.FourPlusCount);
1055
    first = false;
1056
    sb.append(")");
1057
    return sb.toString();
1058
  }
1059
 
1060
  public void validate() throws org.apache.thrift.TException {
1061
    // check for required fields
1062
  }
1063
 
1064
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1065
    try {
1066
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1067
    } catch (org.apache.thrift.TException te) {
1068
      throw new java.io.IOException(te);
1069
    }
1070
  }
1071
 
1072
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1073
    try {
1074
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1075
      __isset_bit_vector = new BitSet(1);
1076
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1077
    } catch (org.apache.thrift.TException te) {
1078
      throw new java.io.IOException(te);
1079
    }
1080
  }
1081
 
1082
}
1083