Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6548 amar.kumar 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 InventoryAvailability implements org.apache.thrift.TBase<InventoryAvailability, InventoryAvailability._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InventoryAvailability");
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 QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.I64, (short)6);
32
 
33
  private long itemId; // required
34
  private String brand; // required
35
  private String modelName; // required
36
  private String modelNumber; // required
37
  private String color; // required
38
  private long quantity; // 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
    BRAND((short)2, "brand"),
44
    MODEL_NAME((short)3, "modelName"),
45
    MODEL_NUMBER((short)4, "modelNumber"),
46
    COLOR((short)5, "color"),
47
    QUANTITY((short)6, "quantity");
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: // BRAND
65
          return BRAND;
66
        case 3: // MODEL_NAME
67
          return MODEL_NAME;
68
        case 4: // MODEL_NUMBER
69
          return MODEL_NUMBER;
70
        case 5: // COLOR
71
          return COLOR;
72
        case 6: // QUANTITY
73
          return QUANTITY;
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 __QUANTITY_ISSET_ID = 1;
116
  private BitSet __isset_bit_vector = new BitSet(2);
117
 
118
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
119
  static {
120
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
121
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
122
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
123
    tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
124
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
125
    tmpMap.put(_Fields.MODEL_NAME, new org.apache.thrift.meta_data.FieldMetaData("modelName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
126
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
127
    tmpMap.put(_Fields.MODEL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("modelNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
128
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
129
    tmpMap.put(_Fields.COLOR, new org.apache.thrift.meta_data.FieldMetaData("color", org.apache.thrift.TFieldRequirementType.DEFAULT, 
130
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
131
    tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
132
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
133
    metaDataMap = Collections.unmodifiableMap(tmpMap);
134
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(InventoryAvailability.class, metaDataMap);
135
  }
136
 
137
  public InventoryAvailability() {
138
  }
139
 
140
  public InventoryAvailability(
141
    long itemId,
142
    String brand,
143
    String modelName,
144
    String modelNumber,
145
    String color,
146
    long quantity)
147
  {
148
    this();
149
    this.itemId = itemId;
150
    setItemIdIsSet(true);
151
    this.brand = brand;
152
    this.modelName = modelName;
153
    this.modelNumber = modelNumber;
154
    this.color = color;
155
    this.quantity = quantity;
156
    setQuantityIsSet(true);
157
  }
158
 
159
  /**
160
   * Performs a deep copy on <i>other</i>.
161
   */
162
  public InventoryAvailability(InventoryAvailability other) {
163
    __isset_bit_vector.clear();
164
    __isset_bit_vector.or(other.__isset_bit_vector);
165
    this.itemId = other.itemId;
166
    if (other.isSetBrand()) {
167
      this.brand = other.brand;
168
    }
169
    if (other.isSetModelName()) {
170
      this.modelName = other.modelName;
171
    }
172
    if (other.isSetModelNumber()) {
173
      this.modelNumber = other.modelNumber;
174
    }
175
    if (other.isSetColor()) {
176
      this.color = other.color;
177
    }
178
    this.quantity = other.quantity;
179
  }
180
 
181
  public InventoryAvailability deepCopy() {
182
    return new InventoryAvailability(this);
183
  }
184
 
185
  @Override
186
  public void clear() {
187
    setItemIdIsSet(false);
188
    this.itemId = 0;
189
    this.brand = null;
190
    this.modelName = null;
191
    this.modelNumber = null;
192
    this.color = null;
193
    setQuantityIsSet(false);
194
    this.quantity = 0;
195
  }
196
 
197
  public long getItemId() {
198
    return this.itemId;
199
  }
200
 
201
  public void setItemId(long itemId) {
202
    this.itemId = itemId;
203
    setItemIdIsSet(true);
204
  }
205
 
206
  public void unsetItemId() {
207
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
208
  }
209
 
210
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
211
  public boolean isSetItemId() {
212
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
213
  }
214
 
215
  public void setItemIdIsSet(boolean value) {
216
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
217
  }
218
 
219
  public String getBrand() {
220
    return this.brand;
221
  }
222
 
223
  public void setBrand(String brand) {
224
    this.brand = brand;
225
  }
226
 
227
  public void unsetBrand() {
228
    this.brand = null;
229
  }
230
 
231
  /** Returns true if field brand is set (has been assigned a value) and false otherwise */
232
  public boolean isSetBrand() {
233
    return this.brand != null;
234
  }
235
 
236
  public void setBrandIsSet(boolean value) {
237
    if (!value) {
238
      this.brand = null;
239
    }
240
  }
241
 
242
  public String getModelName() {
243
    return this.modelName;
244
  }
245
 
246
  public void setModelName(String modelName) {
247
    this.modelName = modelName;
248
  }
249
 
250
  public void unsetModelName() {
251
    this.modelName = null;
252
  }
253
 
254
  /** Returns true if field modelName is set (has been assigned a value) and false otherwise */
255
  public boolean isSetModelName() {
256
    return this.modelName != null;
257
  }
258
 
259
  public void setModelNameIsSet(boolean value) {
260
    if (!value) {
261
      this.modelName = null;
262
    }
263
  }
264
 
265
  public String getModelNumber() {
266
    return this.modelNumber;
267
  }
268
 
269
  public void setModelNumber(String modelNumber) {
270
    this.modelNumber = modelNumber;
271
  }
272
 
273
  public void unsetModelNumber() {
274
    this.modelNumber = null;
275
  }
276
 
277
  /** Returns true if field modelNumber is set (has been assigned a value) and false otherwise */
278
  public boolean isSetModelNumber() {
279
    return this.modelNumber != null;
280
  }
281
 
282
  public void setModelNumberIsSet(boolean value) {
283
    if (!value) {
284
      this.modelNumber = null;
285
    }
286
  }
287
 
288
  public String getColor() {
289
    return this.color;
290
  }
291
 
292
  public void setColor(String color) {
293
    this.color = color;
294
  }
295
 
296
  public void unsetColor() {
297
    this.color = null;
298
  }
299
 
300
  /** Returns true if field color is set (has been assigned a value) and false otherwise */
301
  public boolean isSetColor() {
302
    return this.color != null;
303
  }
304
 
305
  public void setColorIsSet(boolean value) {
306
    if (!value) {
307
      this.color = null;
308
    }
309
  }
310
 
311
  public long getQuantity() {
312
    return this.quantity;
313
  }
314
 
315
  public void setQuantity(long quantity) {
316
    this.quantity = quantity;
317
    setQuantityIsSet(true);
318
  }
319
 
320
  public void unsetQuantity() {
321
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
322
  }
323
 
324
  /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
325
  public boolean isSetQuantity() {
326
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
327
  }
328
 
329
  public void setQuantityIsSet(boolean value) {
330
    __isset_bit_vector.set(__QUANTITY_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 BRAND:
344
      if (value == null) {
345
        unsetBrand();
346
      } else {
347
        setBrand((String)value);
348
      }
349
      break;
350
 
351
    case MODEL_NAME:
352
      if (value == null) {
353
        unsetModelName();
354
      } else {
355
        setModelName((String)value);
356
      }
357
      break;
358
 
359
    case MODEL_NUMBER:
360
      if (value == null) {
361
        unsetModelNumber();
362
      } else {
363
        setModelNumber((String)value);
364
      }
365
      break;
366
 
367
    case COLOR:
368
      if (value == null) {
369
        unsetColor();
370
      } else {
371
        setColor((String)value);
372
      }
373
      break;
374
 
375
    case QUANTITY:
376
      if (value == null) {
377
        unsetQuantity();
378
      } else {
379
        setQuantity((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 BRAND:
392
      return getBrand();
393
 
394
    case MODEL_NAME:
395
      return getModelName();
396
 
397
    case MODEL_NUMBER:
398
      return getModelNumber();
399
 
400
    case COLOR:
401
      return getColor();
402
 
403
    case QUANTITY:
404
      return Long.valueOf(getQuantity());
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 BRAND:
420
      return isSetBrand();
421
    case MODEL_NAME:
422
      return isSetModelName();
423
    case MODEL_NUMBER:
424
      return isSetModelNumber();
425
    case COLOR:
426
      return isSetColor();
427
    case QUANTITY:
428
      return isSetQuantity();
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 InventoryAvailability)
438
      return this.equals((InventoryAvailability)that);
439
    return false;
440
  }
441
 
442
  public boolean equals(InventoryAvailability 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_brand = true && this.isSetBrand();
456
    boolean that_present_brand = true && that.isSetBrand();
457
    if (this_present_brand || that_present_brand) {
458
      if (!(this_present_brand && that_present_brand))
459
        return false;
460
      if (!this.brand.equals(that.brand))
461
        return false;
462
    }
463
 
464
    boolean this_present_modelName = true && this.isSetModelName();
465
    boolean that_present_modelName = true && that.isSetModelName();
466
    if (this_present_modelName || that_present_modelName) {
467
      if (!(this_present_modelName && that_present_modelName))
468
        return false;
469
      if (!this.modelName.equals(that.modelName))
470
        return false;
471
    }
472
 
473
    boolean this_present_modelNumber = true && this.isSetModelNumber();
474
    boolean that_present_modelNumber = true && that.isSetModelNumber();
475
    if (this_present_modelNumber || that_present_modelNumber) {
476
      if (!(this_present_modelNumber && that_present_modelNumber))
477
        return false;
478
      if (!this.modelNumber.equals(that.modelNumber))
479
        return false;
480
    }
481
 
482
    boolean this_present_color = true && this.isSetColor();
483
    boolean that_present_color = true && that.isSetColor();
484
    if (this_present_color || that_present_color) {
485
      if (!(this_present_color && that_present_color))
486
        return false;
487
      if (!this.color.equals(that.color))
488
        return false;
489
    }
490
 
491
    boolean this_present_quantity = true;
492
    boolean that_present_quantity = true;
493
    if (this_present_quantity || that_present_quantity) {
494
      if (!(this_present_quantity && that_present_quantity))
495
        return false;
496
      if (this.quantity != that.quantity)
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(InventoryAvailability other) {
509
    if (!getClass().equals(other.getClass())) {
510
      return getClass().getName().compareTo(other.getClass().getName());
511
    }
512
 
513
    int lastComparison = 0;
514
    InventoryAvailability typedOther = (InventoryAvailability)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(isSetBrand()).compareTo(typedOther.isSetBrand());
527
    if (lastComparison != 0) {
528
      return lastComparison;
529
    }
530
    if (isSetBrand()) {
531
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
532
      if (lastComparison != 0) {
533
        return lastComparison;
534
      }
535
    }
536
    lastComparison = Boolean.valueOf(isSetModelName()).compareTo(typedOther.isSetModelName());
537
    if (lastComparison != 0) {
538
      return lastComparison;
539
    }
540
    if (isSetModelName()) {
541
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelName, typedOther.modelName);
542
      if (lastComparison != 0) {
543
        return lastComparison;
544
      }
545
    }
546
    lastComparison = Boolean.valueOf(isSetModelNumber()).compareTo(typedOther.isSetModelNumber());
547
    if (lastComparison != 0) {
548
      return lastComparison;
549
    }
550
    if (isSetModelNumber()) {
551
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelNumber, typedOther.modelNumber);
552
      if (lastComparison != 0) {
553
        return lastComparison;
554
      }
555
    }
556
    lastComparison = Boolean.valueOf(isSetColor()).compareTo(typedOther.isSetColor());
557
    if (lastComparison != 0) {
558
      return lastComparison;
559
    }
560
    if (isSetColor()) {
561
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.color, typedOther.color);
562
      if (lastComparison != 0) {
563
        return lastComparison;
564
      }
565
    }
566
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
567
    if (lastComparison != 0) {
568
      return lastComparison;
569
    }
570
    if (isSetQuantity()) {
571
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
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: // BRAND
602
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
603
            this.brand = iprot.readString();
604
          } else { 
605
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
606
          }
607
          break;
608
        case 3: // MODEL_NAME
609
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
610
            this.modelName = iprot.readString();
611
          } else { 
612
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
613
          }
614
          break;
615
        case 4: // MODEL_NUMBER
616
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
617
            this.modelNumber = iprot.readString();
618
          } else { 
619
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
620
          }
621
          break;
622
        case 5: // COLOR
623
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
624
            this.color = iprot.readString();
625
          } else { 
626
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
627
          }
628
          break;
629
        case 6: // QUANTITY
630
          if (field.type == org.apache.thrift.protocol.TType.I64) {
631
            this.quantity = iprot.readI64();
632
            setQuantityIsSet(true);
633
          } else { 
634
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
635
          }
636
          break;
637
        default:
638
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
639
      }
640
      iprot.readFieldEnd();
641
    }
642
    iprot.readStructEnd();
643
    validate();
644
  }
645
 
646
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
647
    validate();
648
 
649
    oprot.writeStructBegin(STRUCT_DESC);
650
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
651
    oprot.writeI64(this.itemId);
652
    oprot.writeFieldEnd();
653
    if (this.brand != null) {
654
      oprot.writeFieldBegin(BRAND_FIELD_DESC);
655
      oprot.writeString(this.brand);
656
      oprot.writeFieldEnd();
657
    }
658
    if (this.modelName != null) {
659
      oprot.writeFieldBegin(MODEL_NAME_FIELD_DESC);
660
      oprot.writeString(this.modelName);
661
      oprot.writeFieldEnd();
662
    }
663
    if (this.modelNumber != null) {
664
      oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
665
      oprot.writeString(this.modelNumber);
666
      oprot.writeFieldEnd();
667
    }
668
    if (this.color != null) {
669
      oprot.writeFieldBegin(COLOR_FIELD_DESC);
670
      oprot.writeString(this.color);
671
      oprot.writeFieldEnd();
672
    }
673
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
674
    oprot.writeI64(this.quantity);
675
    oprot.writeFieldEnd();
676
    oprot.writeFieldStop();
677
    oprot.writeStructEnd();
678
  }
679
 
680
  @Override
681
  public String toString() {
682
    StringBuilder sb = new StringBuilder("InventoryAvailability(");
683
    boolean first = true;
684
 
685
    sb.append("itemId:");
686
    sb.append(this.itemId);
687
    first = false;
688
    if (!first) sb.append(", ");
689
    sb.append("brand:");
690
    if (this.brand == null) {
691
      sb.append("null");
692
    } else {
693
      sb.append(this.brand);
694
    }
695
    first = false;
696
    if (!first) sb.append(", ");
697
    sb.append("modelName:");
698
    if (this.modelName == null) {
699
      sb.append("null");
700
    } else {
701
      sb.append(this.modelName);
702
    }
703
    first = false;
704
    if (!first) sb.append(", ");
705
    sb.append("modelNumber:");
706
    if (this.modelNumber == null) {
707
      sb.append("null");
708
    } else {
709
      sb.append(this.modelNumber);
710
    }
711
    first = false;
712
    if (!first) sb.append(", ");
713
    sb.append("color:");
714
    if (this.color == null) {
715
      sb.append("null");
716
    } else {
717
      sb.append(this.color);
718
    }
719
    first = false;
720
    if (!first) sb.append(", ");
721
    sb.append("quantity:");
722
    sb.append(this.quantity);
723
    first = false;
724
    sb.append(")");
725
    return sb.toString();
726
  }
727
 
728
  public void validate() throws org.apache.thrift.TException {
729
    // check for required fields
730
  }
731
 
732
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
733
    try {
734
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
735
    } catch (org.apache.thrift.TException te) {
736
      throw new java.io.IOException(te);
737
    }
738
  }
739
 
740
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
741
    try {
742
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
743
      __isset_bit_vector = new BitSet(1);
744
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
745
    } catch (org.apache.thrift.TException te) {
746
      throw new java.io.IOException(te);
747
    }
748
  }
749
 
750
}
751