Subversion Repositories SmartDukaan

Rev

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

Rev 7281 Rev 10450
Line 24... Line 24...
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AmazonInventorySnapshot");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AmazonInventorySnapshot");
25
 
25
 
26
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
26
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_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.I64, (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.I64, (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.I64, (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.I64, (short)3);
-
 
29
  private static final org.apache.thrift.protocol.TField IS_OOS_FIELD_DESC = new org.apache.thrift.protocol.TField("is_oos", org.apache.thrift.protocol.TType.BOOL, (short)4);
29
 
30
 
30
  private long item_id; // required
31
  private long item_id; // required
31
  private long availability; // required
32
  private long availability; // required
32
  private long reserved; // required
33
  private long reserved; // required
-
 
34
  private boolean is_oos; // 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
    ITEM_ID((short)1, "item_id"),
38
    ITEM_ID((short)1, "item_id"),
37
    AVAILABILITY((short)2, "availability"),
39
    AVAILABILITY((short)2, "availability"),
38
    RESERVED((short)3, "reserved");
40
    RESERVED((short)3, "reserved"),
-
 
41
    IS_OOS((short)4, "is_oos");
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 ITEM_ID;
57
          return ITEM_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: // IS_OOS
-
 
63
          return IS_OOS;
59
        default:
64
        default:
60
          return null;
65
          return null;
61
      }
66
      }
62
    }
67
    }
63
 
68
 
Line 97... Line 102...
97
 
102
 
98
  // isset id assignments
103
  // isset id assignments
99
  private static final int __ITEM_ID_ISSET_ID = 0;
104
  private static final int __ITEM_ID_ISSET_ID = 0;
100
  private static final int __AVAILABILITY_ISSET_ID = 1;
105
  private static final int __AVAILABILITY_ISSET_ID = 1;
101
  private static final int __RESERVED_ISSET_ID = 2;
106
  private static final int __RESERVED_ISSET_ID = 2;
-
 
107
  private static final int __IS_OOS_ISSET_ID = 3;
102
  private BitSet __isset_bit_vector = new BitSet(3);
108
  private BitSet __isset_bit_vector = new BitSet(4);
103
 
109
 
104
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
110
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
105
  static {
111
  static {
106
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
112
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
107
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
113
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
108
        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)));
109
    tmpMap.put(_Fields.AVAILABILITY, new org.apache.thrift.meta_data.FieldMetaData("availability", org.apache.thrift.TFieldRequirementType.DEFAULT, 
115
    tmpMap.put(_Fields.AVAILABILITY, new org.apache.thrift.meta_data.FieldMetaData("availability", org.apache.thrift.TFieldRequirementType.DEFAULT, 
110
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
116
        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, 
117
    tmpMap.put(_Fields.RESERVED, new org.apache.thrift.meta_data.FieldMetaData("reserved", org.apache.thrift.TFieldRequirementType.DEFAULT, 
112
        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)));
-
 
119
    tmpMap.put(_Fields.IS_OOS, new org.apache.thrift.meta_data.FieldMetaData("is_oos", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
120
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
113
    metaDataMap = Collections.unmodifiableMap(tmpMap);
121
    metaDataMap = Collections.unmodifiableMap(tmpMap);
114
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AmazonInventorySnapshot.class, metaDataMap);
122
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AmazonInventorySnapshot.class, metaDataMap);
115
  }
123
  }
116
 
124
 
117
  public AmazonInventorySnapshot() {
125
  public AmazonInventorySnapshot() {
118
  }
126
  }
119
 
127
 
120
  public AmazonInventorySnapshot(
128
  public AmazonInventorySnapshot(
121
    long item_id,
129
    long item_id,
122
    long availability,
130
    long availability,
123
    long reserved)
131
    long reserved,
-
 
132
    boolean is_oos)
124
  {
133
  {
125
    this();
134
    this();
126
    this.item_id = item_id;
135
    this.item_id = item_id;
127
    setItem_idIsSet(true);
136
    setItem_idIsSet(true);
128
    this.availability = availability;
137
    this.availability = availability;
129
    setAvailabilityIsSet(true);
138
    setAvailabilityIsSet(true);
130
    this.reserved = reserved;
139
    this.reserved = reserved;
131
    setReservedIsSet(true);
140
    setReservedIsSet(true);
-
 
141
    this.is_oos = is_oos;
-
 
142
    setIs_oosIsSet(true);
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 138... Line 149...
138
    __isset_bit_vector.clear();
149
    __isset_bit_vector.clear();
139
    __isset_bit_vector.or(other.__isset_bit_vector);
150
    __isset_bit_vector.or(other.__isset_bit_vector);
140
    this.item_id = other.item_id;
151
    this.item_id = other.item_id;
141
    this.availability = other.availability;
152
    this.availability = other.availability;
142
    this.reserved = other.reserved;
153
    this.reserved = other.reserved;
-
 
154
    this.is_oos = other.is_oos;
143
  }
155
  }
144
 
156
 
145
  public AmazonInventorySnapshot deepCopy() {
157
  public AmazonInventorySnapshot deepCopy() {
146
    return new AmazonInventorySnapshot(this);
158
    return new AmazonInventorySnapshot(this);
147
  }
159
  }
Line 152... Line 164...
152
    this.item_id = 0;
164
    this.item_id = 0;
153
    setAvailabilityIsSet(false);
165
    setAvailabilityIsSet(false);
154
    this.availability = 0;
166
    this.availability = 0;
155
    setReservedIsSet(false);
167
    setReservedIsSet(false);
156
    this.reserved = 0;
168
    this.reserved = 0;
-
 
169
    setIs_oosIsSet(false);
-
 
170
    this.is_oos = false;
157
  }
171
  }
158
 
172
 
159
  public long getItem_id() {
173
  public long getItem_id() {
160
    return this.item_id;
174
    return this.item_id;
161
  }
175
  }
Line 220... Line 234...
220
 
234
 
221
  public void setReservedIsSet(boolean value) {
235
  public void setReservedIsSet(boolean value) {
222
    __isset_bit_vector.set(__RESERVED_ISSET_ID, value);
236
    __isset_bit_vector.set(__RESERVED_ISSET_ID, value);
223
  }
237
  }
224
 
238
 
-
 
239
  public boolean isIs_oos() {
-
 
240
    return this.is_oos;
-
 
241
  }
-
 
242
 
-
 
243
  public void setIs_oos(boolean is_oos) {
-
 
244
    this.is_oos = is_oos;
-
 
245
    setIs_oosIsSet(true);
-
 
246
  }
-
 
247
 
-
 
248
  public void unsetIs_oos() {
-
 
249
    __isset_bit_vector.clear(__IS_OOS_ISSET_ID);
-
 
250
  }
-
 
251
 
-
 
252
  /** Returns true if field is_oos is set (has been assigned a value) and false otherwise */
-
 
253
  public boolean isSetIs_oos() {
-
 
254
    return __isset_bit_vector.get(__IS_OOS_ISSET_ID);
-
 
255
  }
-
 
256
 
-
 
257
  public void setIs_oosIsSet(boolean value) {
-
 
258
    __isset_bit_vector.set(__IS_OOS_ISSET_ID, value);
-
 
259
  }
-
 
260
 
225
  public void setFieldValue(_Fields field, Object value) {
261
  public void setFieldValue(_Fields field, Object value) {
226
    switch (field) {
262
    switch (field) {
227
    case ITEM_ID:
263
    case ITEM_ID:
228
      if (value == null) {
264
      if (value == null) {
229
        unsetItem_id();
265
        unsetItem_id();
Line 246... Line 282...
246
      } else {
282
      } else {
247
        setReserved((Long)value);
283
        setReserved((Long)value);
248
      }
284
      }
249
      break;
285
      break;
250
 
286
 
-
 
287
    case IS_OOS:
-
 
288
      if (value == null) {
-
 
289
        unsetIs_oos();
-
 
290
      } else {
-
 
291
        setIs_oos((Boolean)value);
-
 
292
      }
-
 
293
      break;
-
 
294
 
251
    }
295
    }
252
  }
296
  }
253
 
297
 
254
  public Object getFieldValue(_Fields field) {
298
  public Object getFieldValue(_Fields field) {
255
    switch (field) {
299
    switch (field) {
Line 260... Line 304...
260
      return Long.valueOf(getAvailability());
304
      return Long.valueOf(getAvailability());
261
 
305
 
262
    case RESERVED:
306
    case RESERVED:
263
      return Long.valueOf(getReserved());
307
      return Long.valueOf(getReserved());
264
 
308
 
-
 
309
    case IS_OOS:
-
 
310
      return Boolean.valueOf(isIs_oos());
-
 
311
 
265
    }
312
    }
266
    throw new IllegalStateException();
313
    throw new IllegalStateException();
267
  }
314
  }
268
 
315
 
269
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
316
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 277... Line 324...
277
      return isSetItem_id();
324
      return isSetItem_id();
278
    case AVAILABILITY:
325
    case AVAILABILITY:
279
      return isSetAvailability();
326
      return isSetAvailability();
280
    case RESERVED:
327
    case RESERVED:
281
      return isSetReserved();
328
      return isSetReserved();
-
 
329
    case IS_OOS:
-
 
330
      return isSetIs_oos();
282
    }
331
    }
283
    throw new IllegalStateException();
332
    throw new IllegalStateException();
284
  }
333
  }
285
 
334
 
286
  @Override
335
  @Override
Line 321... Line 370...
321
        return false;
370
        return false;
322
      if (this.reserved != that.reserved)
371
      if (this.reserved != that.reserved)
323
        return false;
372
        return false;
324
    }
373
    }
325
 
374
 
-
 
375
    boolean this_present_is_oos = true;
-
 
376
    boolean that_present_is_oos = true;
-
 
377
    if (this_present_is_oos || that_present_is_oos) {
-
 
378
      if (!(this_present_is_oos && that_present_is_oos))
-
 
379
        return false;
-
 
380
      if (this.is_oos != that.is_oos)
-
 
381
        return false;
-
 
382
    }
-
 
383
 
326
    return true;
384
    return true;
327
  }
385
  }
328
 
386
 
329
  @Override
387
  @Override
330
  public int hashCode() {
388
  public int hashCode() {
Line 367... Line 425...
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reserved, typedOther.reserved);
425
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reserved, typedOther.reserved);
368
      if (lastComparison != 0) {
426
      if (lastComparison != 0) {
369
        return lastComparison;
427
        return lastComparison;
370
      }
428
      }
371
    }
429
    }
-
 
430
    lastComparison = Boolean.valueOf(isSetIs_oos()).compareTo(typedOther.isSetIs_oos());
-
 
431
    if (lastComparison != 0) {
-
 
432
      return lastComparison;
-
 
433
    }
-
 
434
    if (isSetIs_oos()) {
-
 
435
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.is_oos, typedOther.is_oos);
-
 
436
      if (lastComparison != 0) {
-
 
437
        return lastComparison;
-
 
438
      }
-
 
439
    }
372
    return 0;
440
    return 0;
373
  }
441
  }
374
 
442
 
375
  public _Fields fieldForId(int fieldId) {
443
  public _Fields fieldForId(int fieldId) {
376
    return _Fields.findByThriftId(fieldId);
444
    return _Fields.findByThriftId(fieldId);
Line 408... Line 476...
408
            setReservedIsSet(true);
476
            setReservedIsSet(true);
409
          } else { 
477
          } else { 
410
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
478
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
411
          }
479
          }
412
          break;
480
          break;
-
 
481
        case 4: // IS_OOS
-
 
482
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
-
 
483
            this.is_oos = iprot.readBool();
-
 
484
            setIs_oosIsSet(true);
-
 
485
          } else { 
-
 
486
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
487
          }
-
 
488
          break;
413
        default:
489
        default:
414
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
490
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
415
      }
491
      }
416
      iprot.readFieldEnd();
492
      iprot.readFieldEnd();
417
    }
493
    }
Line 430... Line 506...
430
    oprot.writeI64(this.availability);
506
    oprot.writeI64(this.availability);
431
    oprot.writeFieldEnd();
507
    oprot.writeFieldEnd();
432
    oprot.writeFieldBegin(RESERVED_FIELD_DESC);
508
    oprot.writeFieldBegin(RESERVED_FIELD_DESC);
433
    oprot.writeI64(this.reserved);
509
    oprot.writeI64(this.reserved);
434
    oprot.writeFieldEnd();
510
    oprot.writeFieldEnd();
-
 
511
    oprot.writeFieldBegin(IS_OOS_FIELD_DESC);
-
 
512
    oprot.writeBool(this.is_oos);
-
 
513
    oprot.writeFieldEnd();
435
    oprot.writeFieldStop();
514
    oprot.writeFieldStop();
436
    oprot.writeStructEnd();
515
    oprot.writeStructEnd();
437
  }
516
  }
438
 
517
 
439
  @Override
518
  @Override
Line 450... Line 529...
450
    first = false;
529
    first = false;
451
    if (!first) sb.append(", ");
530
    if (!first) sb.append(", ");
452
    sb.append("reserved:");
531
    sb.append("reserved:");
453
    sb.append(this.reserved);
532
    sb.append(this.reserved);
454
    first = false;
533
    first = false;
-
 
534
    if (!first) sb.append(", ");
-
 
535
    sb.append("is_oos:");
-
 
536
    sb.append(this.is_oos);
-
 
537
    first = false;
455
    sb.append(")");
538
    sb.append(")");
456
    return sb.toString();
539
    return sb.toString();
457
  }
540
  }
458
 
541
 
459
  public void validate() throws org.apache.thrift.TException {
542
  public void validate() throws org.apache.thrift.TException {