Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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