Subversion Repositories SmartDukaan

Rev

Rev 5945 | Details | Compare with Previous | Last modification | View Log | RSS feed

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