Subversion Repositories SmartDukaan

Rev

Rev 5945 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5945 Rev 8182
Line 24... Line 24...
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ItemInventory");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ItemInventory");
25
 
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);
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);
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);
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);
-
 
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);
29
 
30
 
30
  private long id; // required
31
  private long id; // required
31
  private Map<Long,Long> availability; // required
32
  private Map<Long,Long> availability; // required
32
  private Map<Long,Long> reserved; // required
33
  private Map<Long,Long> reserved; // required
-
 
34
  private Map<Long,Long> held; // required
33
 
35
 
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
37
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
36
    ID((short)1, "id"),
38
    ID((short)1, "id"),
37
    AVAILABILITY((short)2, "availability"),
39
    AVAILABILITY((short)2, "availability"),
38
    RESERVED((short)3, "reserved");
40
    RESERVED((short)3, "reserved"),
-
 
41
    HELD((short)4, "held");
39
 
42
 
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
43
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
41
 
44
 
42
    static {
45
    static {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
46
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 54... Line 57...
54
          return ID;
57
          return ID;
55
        case 2: // AVAILABILITY
58
        case 2: // AVAILABILITY
56
          return AVAILABILITY;
59
          return AVAILABILITY;
57
        case 3: // RESERVED
60
        case 3: // RESERVED
58
          return RESERVED;
61
          return RESERVED;
-
 
62
        case 4: // HELD
-
 
63
          return HELD;
59
        default:
64
        default:
60
          return null;
65
          return null;
61
      }
66
      }
62
    }
67
    }
63
 
68
 
Line 110... Line 115...
110
            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))));
111
    tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT, 
116
    tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT, 
112
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
117
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
113
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
118
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
114
            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))));
-
 
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))));
115
    metaDataMap = Collections.unmodifiableMap(tmpMap);
124
    metaDataMap = Collections.unmodifiableMap(tmpMap);
116
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ItemInventory.class, metaDataMap);
125
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ItemInventory.class, metaDataMap);
117
  }
126
  }
118
 
127
 
119
  public ItemInventory() {
128
  public ItemInventory() {
120
  }
129
  }
121
 
130
 
122
  public ItemInventory(
131
  public ItemInventory(
123
    long id,
132
    long id,
124
    Map<Long,Long> availability,
133
    Map<Long,Long> availability,
125
    Map<Long,Long> reserved)
134
    Map<Long,Long> reserved,
-
 
135
    Map<Long,Long> held)
126
  {
136
  {
127
    this();
137
    this();
128
    this.id = id;
138
    this.id = id;
129
    setIdIsSet(true);
139
    setIdIsSet(true);
130
    this.availability = availability;
140
    this.availability = availability;
131
    this.reserved = reserved;
141
    this.reserved = reserved;
-
 
142
    this.held = held;
132
  }
143
  }
133
 
144
 
134
  /**
145
  /**
135
   * Performs a deep copy on <i>other</i>.
146
   * Performs a deep copy on <i>other</i>.
136
   */
147
   */
Line 166... Line 177...
166
 
177
 
167
        __this__reserved.put(__this__reserved_copy_key, __this__reserved_copy_value);
178
        __this__reserved.put(__this__reserved_copy_key, __this__reserved_copy_value);
168
      }
179
      }
169
      this.reserved = __this__reserved;
180
      this.reserved = __this__reserved;
170
    }
181
    }
-
 
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
    }
171
  }
197
  }
172
 
198
 
173
  public ItemInventory deepCopy() {
199
  public ItemInventory deepCopy() {
174
    return new ItemInventory(this);
200
    return new ItemInventory(this);
175
  }
201
  }
Line 178... Line 204...
178
  public void clear() {
204
  public void clear() {
179
    setIdIsSet(false);
205
    setIdIsSet(false);
180
    this.id = 0;
206
    this.id = 0;
181
    this.availability = null;
207
    this.availability = null;
182
    this.reserved = null;
208
    this.reserved = null;
-
 
209
    this.held = null;
183
  }
210
  }
184
 
211
 
185
  public long getId() {
212
  public long getId() {
186
    return this.id;
213
    return this.id;
187
  }
214
  }
Line 270... Line 297...
270
    if (!value) {
297
    if (!value) {
271
      this.reserved = null;
298
      this.reserved = null;
272
    }
299
    }
273
  }
300
  }
274
 
301
 
-
 
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
 
275
  public void setFieldValue(_Fields field, Object value) {
336
  public void setFieldValue(_Fields field, Object value) {
276
    switch (field) {
337
    switch (field) {
277
    case ID:
338
    case ID:
278
      if (value == null) {
339
      if (value == null) {
279
        unsetId();
340
        unsetId();
Line 296... Line 357...
296
      } else {
357
      } else {
297
        setReserved((Map<Long,Long>)value);
358
        setReserved((Map<Long,Long>)value);
298
      }
359
      }
299
      break;
360
      break;
300
 
361
 
-
 
362
    case HELD:
-
 
363
      if (value == null) {
-
 
364
        unsetHeld();
-
 
365
      } else {
-
 
366
        setHeld((Map<Long,Long>)value);
-
 
367
      }
-
 
368
      break;
-
 
369
 
301
    }
370
    }
302
  }
371
  }
303
 
372
 
304
  public Object getFieldValue(_Fields field) {
373
  public Object getFieldValue(_Fields field) {
305
    switch (field) {
374
    switch (field) {
Line 310... Line 379...
310
      return getAvailability();
379
      return getAvailability();
311
 
380
 
312
    case RESERVED:
381
    case RESERVED:
313
      return getReserved();
382
      return getReserved();
314
 
383
 
-
 
384
    case HELD:
-
 
385
      return getHeld();
-
 
386
 
315
    }
387
    }
316
    throw new IllegalStateException();
388
    throw new IllegalStateException();
317
  }
389
  }
318
 
390
 
319
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
391
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 327... Line 399...
327
      return isSetId();
399
      return isSetId();
328
    case AVAILABILITY:
400
    case AVAILABILITY:
329
      return isSetAvailability();
401
      return isSetAvailability();
330
    case RESERVED:
402
    case RESERVED:
331
      return isSetReserved();
403
      return isSetReserved();
-
 
404
    case HELD:
-
 
405
      return isSetHeld();
332
    }
406
    }
333
    throw new IllegalStateException();
407
    throw new IllegalStateException();
334
  }
408
  }
335
 
409
 
336
  @Override
410
  @Override
Line 371... Line 445...
371
        return false;
445
        return false;
372
      if (!this.reserved.equals(that.reserved))
446
      if (!this.reserved.equals(that.reserved))
373
        return false;
447
        return false;
374
    }
448
    }
375
 
449
 
-
 
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
 
376
    return true;
459
    return true;
377
  }
460
  }
378
 
461
 
379
  @Override
462
  @Override
380
  public int hashCode() {
463
  public int hashCode() {
Line 417... Line 500...
417
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reserved, typedOther.reserved);
500
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reserved, typedOther.reserved);
418
      if (lastComparison != 0) {
501
      if (lastComparison != 0) {
419
        return lastComparison;
502
        return lastComparison;
420
      }
503
      }
421
    }
504
    }
-
 
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
    }
422
    return 0;
515
    return 0;
423
  }
516
  }
424
 
517
 
425
  public _Fields fieldForId(int fieldId) {
518
  public _Fields fieldForId(int fieldId) {
426
    return _Fields.findByThriftId(fieldId);
519
    return _Fields.findByThriftId(fieldId);
Line 480... Line 573...
480
            }
573
            }
481
          } else { 
574
          } else { 
482
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
575
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
483
          }
576
          }
484
          break;
577
          break;
-
 
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;
485
        default:
597
        default:
486
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
598
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
487
      }
599
      }
488
      iprot.readFieldEnd();
600
      iprot.readFieldEnd();
489
    }
601
    }
Line 500... Line 612...
500
    oprot.writeFieldEnd();
612
    oprot.writeFieldEnd();
501
    if (this.availability != null) {
613
    if (this.availability != null) {
502
      oprot.writeFieldBegin(AVAILABILITY_FIELD_DESC);
614
      oprot.writeFieldBegin(AVAILABILITY_FIELD_DESC);
503
      {
615
      {
504
        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.I64, this.availability.size()));
616
        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.I64, this.availability.size()));
505
        for (Map.Entry<Long, Long> _iter8 : this.availability.entrySet())
617
        for (Map.Entry<Long, Long> _iter12 : this.availability.entrySet())
506
        {
618
        {
507
          oprot.writeI64(_iter8.getKey());
619
          oprot.writeI64(_iter12.getKey());
508
          oprot.writeI64(_iter8.getValue());
620
          oprot.writeI64(_iter12.getValue());
509
        }
621
        }
510
        oprot.writeMapEnd();
622
        oprot.writeMapEnd();
511
      }
623
      }
512
      oprot.writeFieldEnd();
624
      oprot.writeFieldEnd();
513
    }
625
    }
514
    if (this.reserved != null) {
626
    if (this.reserved != null) {
515
      oprot.writeFieldBegin(RESERVED_FIELD_DESC);
627
      oprot.writeFieldBegin(RESERVED_FIELD_DESC);
516
      {
628
      {
517
        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.I64, this.reserved.size()));
629
        oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.I64, this.reserved.size()));
518
        for (Map.Entry<Long, Long> _iter9 : this.reserved.entrySet())
630
        for (Map.Entry<Long, Long> _iter13 : this.reserved.entrySet())
-
 
631
        {
-
 
632
          oprot.writeI64(_iter13.getKey());
-
 
633
          oprot.writeI64(_iter13.getValue());
-
 
634
        }
-
 
635
        oprot.writeMapEnd();
-
 
636
      }
-
 
637
      oprot.writeFieldEnd();
-
 
638
    }
-
 
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())
519
        {
644
        {
520
          oprot.writeI64(_iter9.getKey());
645
          oprot.writeI64(_iter14.getKey());
521
          oprot.writeI64(_iter9.getValue());
646
          oprot.writeI64(_iter14.getValue());
522
        }
647
        }
523
        oprot.writeMapEnd();
648
        oprot.writeMapEnd();
524
      }
649
      }
525
      oprot.writeFieldEnd();
650
      oprot.writeFieldEnd();
526
    }
651
    }
Line 550... Line 675...
550
      sb.append("null");
675
      sb.append("null");
551
    } else {
676
    } else {
552
      sb.append(this.reserved);
677
      sb.append(this.reserved);
553
    }
678
    }
554
    first = false;
679
    first = false;
-
 
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;
555
    sb.append(")");
688
    sb.append(")");
556
    return sb.toString();
689
    return sb.toString();
557
  }
690
  }
558
 
691
 
559
  public void validate() throws org.apache.thrift.TException {
692
  public void validate() throws org.apache.thrift.TException {