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