Subversion Repositories SmartDukaan

Rev

Rev 10450 | Details | Compare with Previous | 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.inventory;
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 AmazonFbaInventorySnapshot implements org.apache.thrift.TBase<AmazonFbaInventorySnapshot, AmazonFbaInventorySnapshot._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AmazonFbaInventorySnapshot");
25
 
26
  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)1);
27
  private static final org.apache.thrift.protocol.TField AVAILABILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("availability", org.apache.thrift.protocol.TType.I64, (short)2);
11173 vikram.rag 28
  private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.I32, (short)3);
29
  private static final org.apache.thrift.protocol.TField UNFULFILLABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("unfulfillable", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField RESERVED_FIELD_DESC = new org.apache.thrift.protocol.TField("reserved", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField INBOUND_FIELD_DESC = new org.apache.thrift.protocol.TField("inbound", org.apache.thrift.protocol.TType.I64, (short)6);
8282 kshitij.so 32
 
33
  private long item_id; // required
34
  private long availability; // required
11173 vikram.rag 35
  private AmazonFCWarehouseLocation location; // required
36
  private long unfulfillable; // required
37
  private long reserved; // required
38
  private long inbound; // required
8282 kshitij.so 39
 
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
42
    ITEM_ID((short)1, "item_id"),
10450 vikram.rag 43
    AVAILABILITY((short)2, "availability"),
11173 vikram.rag 44
    /**
45
     * 
46
     * @see AmazonFCWarehouseLocation
47
     */
48
    LOCATION((short)3, "location"),
49
    UNFULFILLABLE((short)4, "unfulfillable"),
50
    RESERVED((short)5, "reserved"),
51
    INBOUND((short)6, "inbound");
8282 kshitij.so 52
 
53
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
54
 
55
    static {
56
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
57
        byName.put(field.getFieldName(), field);
58
      }
59
    }
60
 
61
    /**
62
     * Find the _Fields constant that matches fieldId, or null if its not found.
63
     */
64
    public static _Fields findByThriftId(int fieldId) {
65
      switch(fieldId) {
66
        case 1: // ITEM_ID
67
          return ITEM_ID;
68
        case 2: // AVAILABILITY
69
          return AVAILABILITY;
11173 vikram.rag 70
        case 3: // LOCATION
71
          return LOCATION;
72
        case 4: // UNFULFILLABLE
73
          return UNFULFILLABLE;
74
        case 5: // RESERVED
75
          return RESERVED;
76
        case 6: // INBOUND
77
          return INBOUND;
8282 kshitij.so 78
        default:
79
          return null;
80
      }
81
    }
82
 
83
    /**
84
     * Find the _Fields constant that matches fieldId, throwing an exception
85
     * if it is not found.
86
     */
87
    public static _Fields findByThriftIdOrThrow(int fieldId) {
88
      _Fields fields = findByThriftId(fieldId);
89
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
90
      return fields;
91
    }
92
 
93
    /**
94
     * Find the _Fields constant that matches name, or null if its not found.
95
     */
96
    public static _Fields findByName(String name) {
97
      return byName.get(name);
98
    }
99
 
100
    private final short _thriftId;
101
    private final String _fieldName;
102
 
103
    _Fields(short thriftId, String fieldName) {
104
      _thriftId = thriftId;
105
      _fieldName = fieldName;
106
    }
107
 
108
    public short getThriftFieldId() {
109
      return _thriftId;
110
    }
111
 
112
    public String getFieldName() {
113
      return _fieldName;
114
    }
115
  }
116
 
117
  // isset id assignments
118
  private static final int __ITEM_ID_ISSET_ID = 0;
119
  private static final int __AVAILABILITY_ISSET_ID = 1;
11173 vikram.rag 120
  private static final int __UNFULFILLABLE_ISSET_ID = 2;
121
  private static final int __RESERVED_ISSET_ID = 3;
122
  private static final int __INBOUND_ISSET_ID = 4;
123
  private BitSet __isset_bit_vector = new BitSet(5);
8282 kshitij.so 124
 
125
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
126
  static {
127
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
128
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
129
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
130
    tmpMap.put(_Fields.AVAILABILITY, new org.apache.thrift.meta_data.FieldMetaData("availability", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11173 vikram.rag 132
    tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AmazonFCWarehouseLocation.class)));
134
    tmpMap.put(_Fields.UNFULFILLABLE, new org.apache.thrift.meta_data.FieldMetaData("unfulfillable", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
136
    tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
138
    tmpMap.put(_Fields.INBOUND, new org.apache.thrift.meta_data.FieldMetaData("inbound", org.apache.thrift.TFieldRequirementType.DEFAULT, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8282 kshitij.so 140
    metaDataMap = Collections.unmodifiableMap(tmpMap);
141
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AmazonFbaInventorySnapshot.class, metaDataMap);
142
  }
143
 
144
  public AmazonFbaInventorySnapshot() {
145
  }
146
 
147
  public AmazonFbaInventorySnapshot(
148
    long item_id,
10450 vikram.rag 149
    long availability,
11173 vikram.rag 150
    AmazonFCWarehouseLocation location,
151
    long unfulfillable,
152
    long reserved,
153
    long inbound)
8282 kshitij.so 154
  {
155
    this();
156
    this.item_id = item_id;
157
    setItem_idIsSet(true);
158
    this.availability = availability;
159
    setAvailabilityIsSet(true);
11173 vikram.rag 160
    this.location = location;
161
    this.unfulfillable = unfulfillable;
162
    setUnfulfillableIsSet(true);
163
    this.reserved = reserved;
164
    setReservedIsSet(true);
165
    this.inbound = inbound;
166
    setInboundIsSet(true);
8282 kshitij.so 167
  }
168
 
169
  /**
170
   * Performs a deep copy on <i>other</i>.
171
   */
172
  public AmazonFbaInventorySnapshot(AmazonFbaInventorySnapshot other) {
173
    __isset_bit_vector.clear();
174
    __isset_bit_vector.or(other.__isset_bit_vector);
175
    this.item_id = other.item_id;
176
    this.availability = other.availability;
11173 vikram.rag 177
    if (other.isSetLocation()) {
178
      this.location = other.location;
179
    }
180
    this.unfulfillable = other.unfulfillable;
181
    this.reserved = other.reserved;
182
    this.inbound = other.inbound;
8282 kshitij.so 183
  }
184
 
185
  public AmazonFbaInventorySnapshot deepCopy() {
186
    return new AmazonFbaInventorySnapshot(this);
187
  }
188
 
189
  @Override
190
  public void clear() {
191
    setItem_idIsSet(false);
192
    this.item_id = 0;
193
    setAvailabilityIsSet(false);
194
    this.availability = 0;
11173 vikram.rag 195
    this.location = null;
196
    setUnfulfillableIsSet(false);
197
    this.unfulfillable = 0;
198
    setReservedIsSet(false);
199
    this.reserved = 0;
200
    setInboundIsSet(false);
201
    this.inbound = 0;
8282 kshitij.so 202
  }
203
 
204
  public long getItem_id() {
205
    return this.item_id;
206
  }
207
 
208
  public void setItem_id(long item_id) {
209
    this.item_id = item_id;
210
    setItem_idIsSet(true);
211
  }
212
 
213
  public void unsetItem_id() {
214
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
215
  }
216
 
217
  /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
218
  public boolean isSetItem_id() {
219
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
220
  }
221
 
222
  public void setItem_idIsSet(boolean value) {
223
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
224
  }
225
 
226
  public long getAvailability() {
227
    return this.availability;
228
  }
229
 
230
  public void setAvailability(long availability) {
231
    this.availability = availability;
232
    setAvailabilityIsSet(true);
233
  }
234
 
235
  public void unsetAvailability() {
236
    __isset_bit_vector.clear(__AVAILABILITY_ISSET_ID);
237
  }
238
 
239
  /** Returns true if field availability is set (has been assigned a value) and false otherwise */
240
  public boolean isSetAvailability() {
241
    return __isset_bit_vector.get(__AVAILABILITY_ISSET_ID);
242
  }
243
 
244
  public void setAvailabilityIsSet(boolean value) {
245
    __isset_bit_vector.set(__AVAILABILITY_ISSET_ID, value);
246
  }
247
 
11173 vikram.rag 248
  /**
249
   * 
250
   * @see AmazonFCWarehouseLocation
251
   */
252
  public AmazonFCWarehouseLocation getLocation() {
253
    return this.location;
10450 vikram.rag 254
  }
255
 
11173 vikram.rag 256
  /**
257
   * 
258
   * @see AmazonFCWarehouseLocation
259
   */
260
  public void setLocation(AmazonFCWarehouseLocation location) {
261
    this.location = location;
10450 vikram.rag 262
  }
263
 
11173 vikram.rag 264
  public void unsetLocation() {
265
    this.location = null;
10450 vikram.rag 266
  }
267
 
11173 vikram.rag 268
  /** Returns true if field location is set (has been assigned a value) and false otherwise */
269
  public boolean isSetLocation() {
270
    return this.location != null;
10450 vikram.rag 271
  }
272
 
11173 vikram.rag 273
  public void setLocationIsSet(boolean value) {
274
    if (!value) {
275
      this.location = null;
276
    }
10450 vikram.rag 277
  }
278
 
11173 vikram.rag 279
  public long getUnfulfillable() {
280
    return this.unfulfillable;
281
  }
282
 
283
  public void setUnfulfillable(long unfulfillable) {
284
    this.unfulfillable = unfulfillable;
285
    setUnfulfillableIsSet(true);
286
  }
287
 
288
  public void unsetUnfulfillable() {
289
    __isset_bit_vector.clear(__UNFULFILLABLE_ISSET_ID);
290
  }
291
 
292
  /** Returns true if field unfulfillable is set (has been assigned a value) and false otherwise */
293
  public boolean isSetUnfulfillable() {
294
    return __isset_bit_vector.get(__UNFULFILLABLE_ISSET_ID);
295
  }
296
 
297
  public void setUnfulfillableIsSet(boolean value) {
298
    __isset_bit_vector.set(__UNFULFILLABLE_ISSET_ID, value);
299
  }
300
 
301
  public long getReserved() {
302
    return this.reserved;
303
  }
304
 
305
  public void setReserved(long reserved) {
306
    this.reserved = reserved;
307
    setReservedIsSet(true);
308
  }
309
 
310
  public void unsetReserved() {
311
    __isset_bit_vector.clear(__RESERVED_ISSET_ID);
312
  }
313
 
314
  /** Returns true if field reserved is set (has been assigned a value) and false otherwise */
315
  public boolean isSetReserved() {
316
    return __isset_bit_vector.get(__RESERVED_ISSET_ID);
317
  }
318
 
319
  public void setReservedIsSet(boolean value) {
320
    __isset_bit_vector.set(__RESERVED_ISSET_ID, value);
321
  }
322
 
323
  public long getInbound() {
324
    return this.inbound;
325
  }
326
 
327
  public void setInbound(long inbound) {
328
    this.inbound = inbound;
329
    setInboundIsSet(true);
330
  }
331
 
332
  public void unsetInbound() {
333
    __isset_bit_vector.clear(__INBOUND_ISSET_ID);
334
  }
335
 
336
  /** Returns true if field inbound is set (has been assigned a value) and false otherwise */
337
  public boolean isSetInbound() {
338
    return __isset_bit_vector.get(__INBOUND_ISSET_ID);
339
  }
340
 
341
  public void setInboundIsSet(boolean value) {
342
    __isset_bit_vector.set(__INBOUND_ISSET_ID, value);
343
  }
344
 
8282 kshitij.so 345
  public void setFieldValue(_Fields field, Object value) {
346
    switch (field) {
347
    case ITEM_ID:
348
      if (value == null) {
349
        unsetItem_id();
350
      } else {
351
        setItem_id((Long)value);
352
      }
353
      break;
354
 
355
    case AVAILABILITY:
356
      if (value == null) {
357
        unsetAvailability();
358
      } else {
359
        setAvailability((Long)value);
360
      }
361
      break;
362
 
11173 vikram.rag 363
    case LOCATION:
10450 vikram.rag 364
      if (value == null) {
11173 vikram.rag 365
        unsetLocation();
10450 vikram.rag 366
      } else {
11173 vikram.rag 367
        setLocation((AmazonFCWarehouseLocation)value);
10450 vikram.rag 368
      }
369
      break;
370
 
11173 vikram.rag 371
    case UNFULFILLABLE:
372
      if (value == null) {
373
        unsetUnfulfillable();
374
      } else {
375
        setUnfulfillable((Long)value);
376
      }
377
      break;
378
 
379
    case RESERVED:
380
      if (value == null) {
381
        unsetReserved();
382
      } else {
383
        setReserved((Long)value);
384
      }
385
      break;
386
 
387
    case INBOUND:
388
      if (value == null) {
389
        unsetInbound();
390
      } else {
391
        setInbound((Long)value);
392
      }
393
      break;
394
 
8282 kshitij.so 395
    }
396
  }
397
 
398
  public Object getFieldValue(_Fields field) {
399
    switch (field) {
400
    case ITEM_ID:
401
      return Long.valueOf(getItem_id());
402
 
403
    case AVAILABILITY:
404
      return Long.valueOf(getAvailability());
405
 
11173 vikram.rag 406
    case LOCATION:
407
      return getLocation();
10450 vikram.rag 408
 
11173 vikram.rag 409
    case UNFULFILLABLE:
410
      return Long.valueOf(getUnfulfillable());
411
 
412
    case RESERVED:
413
      return Long.valueOf(getReserved());
414
 
415
    case INBOUND:
416
      return Long.valueOf(getInbound());
417
 
8282 kshitij.so 418
    }
419
    throw new IllegalStateException();
420
  }
421
 
422
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
423
  public boolean isSet(_Fields field) {
424
    if (field == null) {
425
      throw new IllegalArgumentException();
426
    }
427
 
428
    switch (field) {
429
    case ITEM_ID:
430
      return isSetItem_id();
431
    case AVAILABILITY:
432
      return isSetAvailability();
11173 vikram.rag 433
    case LOCATION:
434
      return isSetLocation();
435
    case UNFULFILLABLE:
436
      return isSetUnfulfillable();
437
    case RESERVED:
438
      return isSetReserved();
439
    case INBOUND:
440
      return isSetInbound();
8282 kshitij.so 441
    }
442
    throw new IllegalStateException();
443
  }
444
 
445
  @Override
446
  public boolean equals(Object that) {
447
    if (that == null)
448
      return false;
449
    if (that instanceof AmazonFbaInventorySnapshot)
450
      return this.equals((AmazonFbaInventorySnapshot)that);
451
    return false;
452
  }
453
 
454
  public boolean equals(AmazonFbaInventorySnapshot that) {
455
    if (that == null)
456
      return false;
457
 
458
    boolean this_present_item_id = true;
459
    boolean that_present_item_id = true;
460
    if (this_present_item_id || that_present_item_id) {
461
      if (!(this_present_item_id && that_present_item_id))
462
        return false;
463
      if (this.item_id != that.item_id)
464
        return false;
465
    }
466
 
467
    boolean this_present_availability = true;
468
    boolean that_present_availability = true;
469
    if (this_present_availability || that_present_availability) {
470
      if (!(this_present_availability && that_present_availability))
471
        return false;
472
      if (this.availability != that.availability)
473
        return false;
474
    }
475
 
11173 vikram.rag 476
    boolean this_present_location = true && this.isSetLocation();
477
    boolean that_present_location = true && that.isSetLocation();
478
    if (this_present_location || that_present_location) {
479
      if (!(this_present_location && that_present_location))
10450 vikram.rag 480
        return false;
11173 vikram.rag 481
      if (!this.location.equals(that.location))
10450 vikram.rag 482
        return false;
483
    }
484
 
11173 vikram.rag 485
    boolean this_present_unfulfillable = true;
486
    boolean that_present_unfulfillable = true;
487
    if (this_present_unfulfillable || that_present_unfulfillable) {
488
      if (!(this_present_unfulfillable && that_present_unfulfillable))
489
        return false;
490
      if (this.unfulfillable != that.unfulfillable)
491
        return false;
492
    }
493
 
494
    boolean this_present_reserved = true;
495
    boolean that_present_reserved = true;
496
    if (this_present_reserved || that_present_reserved) {
497
      if (!(this_present_reserved && that_present_reserved))
498
        return false;
499
      if (this.reserved != that.reserved)
500
        return false;
501
    }
502
 
503
    boolean this_present_inbound = true;
504
    boolean that_present_inbound = true;
505
    if (this_present_inbound || that_present_inbound) {
506
      if (!(this_present_inbound && that_present_inbound))
507
        return false;
508
      if (this.inbound != that.inbound)
509
        return false;
510
    }
511
 
8282 kshitij.so 512
    return true;
513
  }
514
 
515
  @Override
516
  public int hashCode() {
517
    return 0;
518
  }
519
 
520
  public int compareTo(AmazonFbaInventorySnapshot other) {
521
    if (!getClass().equals(other.getClass())) {
522
      return getClass().getName().compareTo(other.getClass().getName());
523
    }
524
 
525
    int lastComparison = 0;
526
    AmazonFbaInventorySnapshot typedOther = (AmazonFbaInventorySnapshot)other;
527
 
528
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
529
    if (lastComparison != 0) {
530
      return lastComparison;
531
    }
532
    if (isSetItem_id()) {
533
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
534
      if (lastComparison != 0) {
535
        return lastComparison;
536
      }
537
    }
538
    lastComparison = Boolean.valueOf(isSetAvailability()).compareTo(typedOther.isSetAvailability());
539
    if (lastComparison != 0) {
540
      return lastComparison;
541
    }
542
    if (isSetAvailability()) {
543
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.availability, typedOther.availability);
544
      if (lastComparison != 0) {
545
        return lastComparison;
546
      }
547
    }
11173 vikram.rag 548
    lastComparison = Boolean.valueOf(isSetLocation()).compareTo(typedOther.isSetLocation());
10450 vikram.rag 549
    if (lastComparison != 0) {
550
      return lastComparison;
551
    }
11173 vikram.rag 552
    if (isSetLocation()) {
553
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.location, typedOther.location);
10450 vikram.rag 554
      if (lastComparison != 0) {
555
        return lastComparison;
556
      }
557
    }
11173 vikram.rag 558
    lastComparison = Boolean.valueOf(isSetUnfulfillable()).compareTo(typedOther.isSetUnfulfillable());
559
    if (lastComparison != 0) {
560
      return lastComparison;
561
    }
562
    if (isSetUnfulfillable()) {
563
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unfulfillable, typedOther.unfulfillable);
564
      if (lastComparison != 0) {
565
        return lastComparison;
566
      }
567
    }
568
    lastComparison = Boolean.valueOf(isSetReserved()).compareTo(typedOther.isSetReserved());
569
    if (lastComparison != 0) {
570
      return lastComparison;
571
    }
572
    if (isSetReserved()) {
573
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reserved, typedOther.reserved);
574
      if (lastComparison != 0) {
575
        return lastComparison;
576
      }
577
    }
578
    lastComparison = Boolean.valueOf(isSetInbound()).compareTo(typedOther.isSetInbound());
579
    if (lastComparison != 0) {
580
      return lastComparison;
581
    }
582
    if (isSetInbound()) {
583
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inbound, typedOther.inbound);
584
      if (lastComparison != 0) {
585
        return lastComparison;
586
      }
587
    }
8282 kshitij.so 588
    return 0;
589
  }
590
 
591
  public _Fields fieldForId(int fieldId) {
592
    return _Fields.findByThriftId(fieldId);
593
  }
594
 
595
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
596
    org.apache.thrift.protocol.TField field;
597
    iprot.readStructBegin();
598
    while (true)
599
    {
600
      field = iprot.readFieldBegin();
601
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
602
        break;
603
      }
604
      switch (field.id) {
605
        case 1: // ITEM_ID
606
          if (field.type == org.apache.thrift.protocol.TType.I64) {
607
            this.item_id = iprot.readI64();
608
            setItem_idIsSet(true);
609
          } else { 
610
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
611
          }
612
          break;
613
        case 2: // AVAILABILITY
614
          if (field.type == org.apache.thrift.protocol.TType.I64) {
615
            this.availability = iprot.readI64();
616
            setAvailabilityIsSet(true);
617
          } else { 
618
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
619
          }
620
          break;
11173 vikram.rag 621
        case 3: // LOCATION
622
          if (field.type == org.apache.thrift.protocol.TType.I32) {
623
            this.location = AmazonFCWarehouseLocation.findByValue(iprot.readI32());
10450 vikram.rag 624
          } else { 
625
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
626
          }
627
          break;
11173 vikram.rag 628
        case 4: // UNFULFILLABLE
629
          if (field.type == org.apache.thrift.protocol.TType.I64) {
630
            this.unfulfillable = iprot.readI64();
631
            setUnfulfillableIsSet(true);
632
          } else { 
633
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
634
          }
635
          break;
636
        case 5: // RESERVED
637
          if (field.type == org.apache.thrift.protocol.TType.I64) {
638
            this.reserved = iprot.readI64();
639
            setReservedIsSet(true);
640
          } else { 
641
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
642
          }
643
          break;
644
        case 6: // INBOUND
645
          if (field.type == org.apache.thrift.protocol.TType.I64) {
646
            this.inbound = iprot.readI64();
647
            setInboundIsSet(true);
648
          } else { 
649
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
650
          }
651
          break;
8282 kshitij.so 652
        default:
653
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
654
      }
655
      iprot.readFieldEnd();
656
    }
657
    iprot.readStructEnd();
658
    validate();
659
  }
660
 
661
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
662
    validate();
663
 
664
    oprot.writeStructBegin(STRUCT_DESC);
665
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
666
    oprot.writeI64(this.item_id);
667
    oprot.writeFieldEnd();
668
    oprot.writeFieldBegin(AVAILABILITY_FIELD_DESC);
669
    oprot.writeI64(this.availability);
670
    oprot.writeFieldEnd();
11173 vikram.rag 671
    if (this.location != null) {
672
      oprot.writeFieldBegin(LOCATION_FIELD_DESC);
673
      oprot.writeI32(this.location.getValue());
674
      oprot.writeFieldEnd();
675
    }
676
    oprot.writeFieldBegin(UNFULFILLABLE_FIELD_DESC);
677
    oprot.writeI64(this.unfulfillable);
10450 vikram.rag 678
    oprot.writeFieldEnd();
11173 vikram.rag 679
    oprot.writeFieldBegin(RESERVED_FIELD_DESC);
680
    oprot.writeI64(this.reserved);
681
    oprot.writeFieldEnd();
682
    oprot.writeFieldBegin(INBOUND_FIELD_DESC);
683
    oprot.writeI64(this.inbound);
684
    oprot.writeFieldEnd();
8282 kshitij.so 685
    oprot.writeFieldStop();
686
    oprot.writeStructEnd();
687
  }
688
 
689
  @Override
690
  public String toString() {
691
    StringBuilder sb = new StringBuilder("AmazonFbaInventorySnapshot(");
692
    boolean first = true;
693
 
694
    sb.append("item_id:");
695
    sb.append(this.item_id);
696
    first = false;
697
    if (!first) sb.append(", ");
698
    sb.append("availability:");
699
    sb.append(this.availability);
700
    first = false;
10450 vikram.rag 701
    if (!first) sb.append(", ");
11173 vikram.rag 702
    sb.append("location:");
703
    if (this.location == null) {
704
      sb.append("null");
705
    } else {
706
      sb.append(this.location);
707
    }
10450 vikram.rag 708
    first = false;
11173 vikram.rag 709
    if (!first) sb.append(", ");
710
    sb.append("unfulfillable:");
711
    sb.append(this.unfulfillable);
712
    first = false;
713
    if (!first) sb.append(", ");
714
    sb.append("reserved:");
715
    sb.append(this.reserved);
716
    first = false;
717
    if (!first) sb.append(", ");
718
    sb.append("inbound:");
719
    sb.append(this.inbound);
720
    first = false;
8282 kshitij.so 721
    sb.append(")");
722
    return sb.toString();
723
  }
724
 
725
  public void validate() throws org.apache.thrift.TException {
726
    // check for required fields
727
  }
728
 
729
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
730
    try {
731
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
732
    } catch (org.apache.thrift.TException te) {
733
      throw new java.io.IOException(te);
734
    }
735
  }
736
 
737
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
738
    try {
739
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
740
      __isset_bit_vector = new BitSet(1);
741
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
742
    } catch (org.apache.thrift.TException te) {
743
      throw new java.io.IOException(te);
744
    }
745
  }
746
 
747
}
748