Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
8182 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.model.v1.inventory;
7
 
31223 amit.gupta 8
import java.util.*;
8182 amar.kumar 9
 
10
public class HoldInventoryDetail implements org.apache.thrift.TBase<HoldInventoryDetail, HoldInventoryDetail._Fields>, java.io.Serializable, Cloneable {
11
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("HoldInventoryDetail");
12
 
31223 amit.gupta 13
  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);
14
  private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouse_id", org.apache.thrift.protocol.TType.I64, (short) 2);
15
  private static final org.apache.thrift.protocol.TField HELD_FIELD_DESC = new org.apache.thrift.protocol.TField("held", org.apache.thrift.protocol.TType.I64, (short) 3);
16
  private static final org.apache.thrift.protocol.TField SOURCE_FIELD_DESC = new org.apache.thrift.protocol.TField("source", org.apache.thrift.protocol.TType.I64, (short) 4);
8182 amar.kumar 17
 
18
  private long item_id; // required
19
  private long warehouse_id; // required
20
  private long held; // required
21
  private long source; // required
22
 
31223 amit.gupta 23
  /**
24
   * The set of fields this struct contains, along with convenience methods for finding and manipulating them.
25
   */
8182 amar.kumar 26
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
31223 amit.gupta 27
    ITEM_ID((short) 1, "item_id"),
28
    WAREHOUSE_ID((short) 2, "warehouse_id"),
29
    HELD((short) 3, "held"),
30
    SOURCE((short) 4, "source");
8182 amar.kumar 31
 
32
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
33
 
34
    static {
35
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
36
        byName.put(field.getFieldName(), field);
37
      }
38
    }
39
 
40
    /**
41
     * Find the _Fields constant that matches fieldId, or null if its not found.
42
     */
43
    public static _Fields findByThriftId(int fieldId) {
31223 amit.gupta 44
      switch (fieldId) {
8182 amar.kumar 45
        case 1: // ITEM_ID
46
          return ITEM_ID;
47
        case 2: // WAREHOUSE_ID
48
          return WAREHOUSE_ID;
49
        case 3: // HELD
50
          return HELD;
51
        case 4: // SOURCE
52
          return SOURCE;
53
        default:
54
          return null;
55
      }
56
    }
57
 
58
    /**
59
     * Find the _Fields constant that matches fieldId, throwing an exception
60
     * if it is not found.
61
     */
62
    public static _Fields findByThriftIdOrThrow(int fieldId) {
63
      _Fields fields = findByThriftId(fieldId);
64
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
65
      return fields;
66
    }
67
 
68
    /**
69
     * Find the _Fields constant that matches name, or null if its not found.
70
     */
71
    public static _Fields findByName(String name) {
72
      return byName.get(name);
73
    }
74
 
75
    private final short _thriftId;
76
    private final String _fieldName;
77
 
78
    _Fields(short thriftId, String fieldName) {
79
      _thriftId = thriftId;
80
      _fieldName = fieldName;
81
    }
82
 
83
    public short getThriftFieldId() {
84
      return _thriftId;
85
    }
86
 
87
    public String getFieldName() {
88
      return _fieldName;
89
    }
90
  }
91
 
92
  // isset id assignments
93
  private static final int __ITEM_ID_ISSET_ID = 0;
94
  private static final int __WAREHOUSE_ID_ISSET_ID = 1;
95
  private static final int __HELD_ISSET_ID = 2;
96
  private static final int __SOURCE_ISSET_ID = 3;
97
  private BitSet __isset_bit_vector = new BitSet(4);
98
 
99
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
31223 amit.gupta 100
 
8182 amar.kumar 101
  static {
102
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
31223 amit.gupta 103
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT,
104
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
105
    tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouse_id", org.apache.thrift.TFieldRequirementType.DEFAULT,
106
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
107
    tmpMap.put(_Fields.HELD, new org.apache.thrift.meta_data.FieldMetaData("held", org.apache.thrift.TFieldRequirementType.DEFAULT,
108
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
109
    tmpMap.put(_Fields.SOURCE, new org.apache.thrift.meta_data.FieldMetaData("source", org.apache.thrift.TFieldRequirementType.DEFAULT,
110
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8182 amar.kumar 111
    metaDataMap = Collections.unmodifiableMap(tmpMap);
112
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(HoldInventoryDetail.class, metaDataMap);
113
  }
114
 
115
  public HoldInventoryDetail() {
116
  }
117
 
118
  public HoldInventoryDetail(
31223 amit.gupta 119
          long item_id,
120
          long warehouse_id,
121
          long held,
122
          long source) {
8182 amar.kumar 123
    this();
124
    this.item_id = item_id;
125
    setItem_idIsSet(true);
126
    this.warehouse_id = warehouse_id;
127
    setWarehouse_idIsSet(true);
128
    this.held = held;
129
    setHeldIsSet(true);
130
    this.source = source;
131
    setSourceIsSet(true);
132
  }
133
 
134
  /**
135
   * Performs a deep copy on <i>other</i>.
136
   */
137
  public HoldInventoryDetail(HoldInventoryDetail other) {
138
    __isset_bit_vector.clear();
139
    __isset_bit_vector.or(other.__isset_bit_vector);
140
    this.item_id = other.item_id;
141
    this.warehouse_id = other.warehouse_id;
142
    this.held = other.held;
143
    this.source = other.source;
144
  }
145
 
146
  public HoldInventoryDetail deepCopy() {
147
    return new HoldInventoryDetail(this);
148
  }
149
 
150
  @Override
151
  public void clear() {
152
    setItem_idIsSet(false);
153
    this.item_id = 0;
154
    setWarehouse_idIsSet(false);
155
    this.warehouse_id = 0;
156
    setHeldIsSet(false);
157
    this.held = 0;
158
    setSourceIsSet(false);
159
    this.source = 0;
160
  }
161
 
162
  public long getItem_id() {
163
    return this.item_id;
164
  }
165
 
166
  public void setItem_id(long item_id) {
167
    this.item_id = item_id;
168
    setItem_idIsSet(true);
169
  }
170
 
171
  public void unsetItem_id() {
172
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
173
  }
174
 
31223 amit.gupta 175
  /**
176
   * Returns true if field item_id is set (has been assigned a value) and false otherwise
177
   */
8182 amar.kumar 178
  public boolean isSetItem_id() {
179
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
180
  }
181
 
182
  public void setItem_idIsSet(boolean value) {
183
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
184
  }
185
 
186
  public long getWarehouse_id() {
187
    return this.warehouse_id;
188
  }
189
 
190
  public void setWarehouse_id(long warehouse_id) {
191
    this.warehouse_id = warehouse_id;
192
    setWarehouse_idIsSet(true);
193
  }
194
 
195
  public void unsetWarehouse_id() {
196
    __isset_bit_vector.clear(__WAREHOUSE_ID_ISSET_ID);
197
  }
198
 
31223 amit.gupta 199
  /**
200
   * Returns true if field warehouse_id is set (has been assigned a value) and false otherwise
201
   */
8182 amar.kumar 202
  public boolean isSetWarehouse_id() {
203
    return __isset_bit_vector.get(__WAREHOUSE_ID_ISSET_ID);
204
  }
205
 
206
  public void setWarehouse_idIsSet(boolean value) {
207
    __isset_bit_vector.set(__WAREHOUSE_ID_ISSET_ID, value);
208
  }
209
 
210
  public long getHeld() {
211
    return this.held;
212
  }
213
 
214
  public void setHeld(long held) {
215
    this.held = held;
216
    setHeldIsSet(true);
217
  }
218
 
219
  public void unsetHeld() {
220
    __isset_bit_vector.clear(__HELD_ISSET_ID);
221
  }
222
 
31223 amit.gupta 223
  /**
224
   * Returns true if field held is set (has been assigned a value) and false otherwise
225
   */
8182 amar.kumar 226
  public boolean isSetHeld() {
227
    return __isset_bit_vector.get(__HELD_ISSET_ID);
228
  }
229
 
230
  public void setHeldIsSet(boolean value) {
231
    __isset_bit_vector.set(__HELD_ISSET_ID, value);
232
  }
233
 
234
  public long getSource() {
235
    return this.source;
236
  }
237
 
238
  public void setSource(long source) {
239
    this.source = source;
240
    setSourceIsSet(true);
241
  }
242
 
243
  public void unsetSource() {
244
    __isset_bit_vector.clear(__SOURCE_ISSET_ID);
245
  }
246
 
247
  /** Returns true if field source is set (has been assigned a value) and false otherwise */
248
  public boolean isSetSource() {
249
    return __isset_bit_vector.get(__SOURCE_ISSET_ID);
250
  }
251
 
252
  public void setSourceIsSet(boolean value) {
253
    __isset_bit_vector.set(__SOURCE_ISSET_ID, value);
254
  }
255
 
256
  public void setFieldValue(_Fields field, Object value) {
257
    switch (field) {
31223 amit.gupta 258
      case ITEM_ID:
259
        if (value == null) {
260
          unsetItem_id();
261
        } else {
262
          setItem_id((Long) value);
263
        }
264
        break;
8182 amar.kumar 265
 
31223 amit.gupta 266
      case WAREHOUSE_ID:
267
        if (value == null) {
268
          unsetWarehouse_id();
269
        } else {
270
          setWarehouse_id((Long) value);
271
        }
272
        break;
8182 amar.kumar 273
 
31223 amit.gupta 274
      case HELD:
275
        if (value == null) {
276
          unsetHeld();
277
        } else {
278
          setHeld((Long) value);
279
        }
280
        break;
8182 amar.kumar 281
 
31223 amit.gupta 282
      case SOURCE:
283
        if (value == null) {
284
          unsetSource();
285
        } else {
286
          setSource((Long) value);
287
        }
8182 amar.kumar 288
      break;
289
 
290
    }
291
  }
292
 
293
  public Object getFieldValue(_Fields field) {
294
    switch (field) {
31223 amit.gupta 295
      case ITEM_ID:
296
        return Long.valueOf(getItem_id());
8182 amar.kumar 297
 
31223 amit.gupta 298
      case WAREHOUSE_ID:
299
        return Long.valueOf(getWarehouse_id());
8182 amar.kumar 300
 
31223 amit.gupta 301
      case HELD:
302
        return Long.valueOf(getHeld());
8182 amar.kumar 303
 
31223 amit.gupta 304
      case SOURCE:
305
        return Long.valueOf(getSource());
8182 amar.kumar 306
 
307
    }
308
    throw new IllegalStateException();
309
  }
310
 
311
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
312
  public boolean isSet(_Fields field) {
313
    if (field == null) {
314
      throw new IllegalArgumentException();
315
    }
316
 
317
    switch (field) {
31223 amit.gupta 318
      case ITEM_ID:
319
        return isSetItem_id();
320
      case WAREHOUSE_ID:
321
        return isSetWarehouse_id();
322
      case HELD:
323
        return isSetHeld();
324
      case SOURCE:
325
        return isSetSource();
8182 amar.kumar 326
    }
327
    throw new IllegalStateException();
328
  }
329
 
330
  @Override
331
  public boolean equals(Object that) {
332
    if (that == null)
333
      return false;
334
    if (that instanceof HoldInventoryDetail)
31223 amit.gupta 335
      return this.equals((HoldInventoryDetail) that);
8182 amar.kumar 336
    return false;
337
  }
338
 
339
  public boolean equals(HoldInventoryDetail that) {
340
    if (that == null)
341
      return false;
342
 
343
    boolean this_present_item_id = true;
344
    boolean that_present_item_id = true;
345
    if (this_present_item_id || that_present_item_id) {
346
      if (!(this_present_item_id && that_present_item_id))
347
        return false;
348
      if (this.item_id != that.item_id)
349
        return false;
350
    }
351
 
352
    boolean this_present_warehouse_id = true;
353
    boolean that_present_warehouse_id = true;
354
    if (this_present_warehouse_id || that_present_warehouse_id) {
355
      if (!(this_present_warehouse_id && that_present_warehouse_id))
356
        return false;
357
      if (this.warehouse_id != that.warehouse_id)
358
        return false;
359
    }
360
 
361
    boolean this_present_held = true;
362
    boolean that_present_held = true;
363
    if (this_present_held || that_present_held) {
364
      if (!(this_present_held && that_present_held))
365
        return false;
366
      if (this.held != that.held)
367
        return false;
368
    }
369
 
370
    boolean this_present_source = true;
371
    boolean that_present_source = true;
372
    if (this_present_source || that_present_source) {
373
      if (!(this_present_source && that_present_source))
374
        return false;
375
      if (this.source != that.source)
376
        return false;
377
    }
378
 
379
    return true;
380
  }
381
 
382
  @Override
383
  public int hashCode() {
384
    return 0;
385
  }
386
 
387
  public int compareTo(HoldInventoryDetail other) {
388
    if (!getClass().equals(other.getClass())) {
389
      return getClass().getName().compareTo(other.getClass().getName());
390
    }
391
 
392
    int lastComparison = 0;
31223 amit.gupta 393
    HoldInventoryDetail typedOther = (HoldInventoryDetail) other;
8182 amar.kumar 394
 
395
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
396
    if (lastComparison != 0) {
397
      return lastComparison;
398
    }
399
    if (isSetItem_id()) {
400
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
401
      if (lastComparison != 0) {
402
        return lastComparison;
403
      }
404
    }
405
    lastComparison = Boolean.valueOf(isSetWarehouse_id()).compareTo(typedOther.isSetWarehouse_id());
406
    if (lastComparison != 0) {
407
      return lastComparison;
408
    }
409
    if (isSetWarehouse_id()) {
410
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouse_id, typedOther.warehouse_id);
411
      if (lastComparison != 0) {
412
        return lastComparison;
413
      }
414
    }
415
    lastComparison = Boolean.valueOf(isSetHeld()).compareTo(typedOther.isSetHeld());
416
    if (lastComparison != 0) {
417
      return lastComparison;
418
    }
419
    if (isSetHeld()) {
420
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.held, typedOther.held);
421
      if (lastComparison != 0) {
422
        return lastComparison;
423
      }
424
    }
425
    lastComparison = Boolean.valueOf(isSetSource()).compareTo(typedOther.isSetSource());
426
    if (lastComparison != 0) {
427
      return lastComparison;
428
    }
429
    if (isSetSource()) {
430
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source, typedOther.source);
431
      if (lastComparison != 0) {
432
        return lastComparison;
433
      }
434
    }
435
    return 0;
436
  }
437
 
438
  public _Fields fieldForId(int fieldId) {
439
    return _Fields.findByThriftId(fieldId);
440
  }
441
 
442
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
443
    org.apache.thrift.protocol.TField field;
444
    iprot.readStructBegin();
445
    while (true)
446
    {
447
      field = iprot.readFieldBegin();
31223 amit.gupta 448
      if (field.type == org.apache.thrift.protocol.TType.STOP) {
8182 amar.kumar 449
        break;
450
      }
451
      switch (field.id) {
452
        case 1: // ITEM_ID
453
          if (field.type == org.apache.thrift.protocol.TType.I64) {
454
            this.item_id = iprot.readI64();
455
            setItem_idIsSet(true);
31223 amit.gupta 456
          } else {
8182 amar.kumar 457
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
458
          }
459
          break;
460
        case 2: // WAREHOUSE_ID
461
          if (field.type == org.apache.thrift.protocol.TType.I64) {
462
            this.warehouse_id = iprot.readI64();
463
            setWarehouse_idIsSet(true);
31223 amit.gupta 464
          } else {
8182 amar.kumar 465
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
466
          }
467
          break;
468
        case 3: // HELD
469
          if (field.type == org.apache.thrift.protocol.TType.I64) {
470
            this.held = iprot.readI64();
471
            setHeldIsSet(true);
31223 amit.gupta 472
          } else {
8182 amar.kumar 473
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
474
          }
475
          break;
476
        case 4: // SOURCE
477
          if (field.type == org.apache.thrift.protocol.TType.I64) {
478
            this.source = iprot.readI64();
479
            setSourceIsSet(true);
480
          } else { 
481
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
482
          }
483
          break;
484
        default:
485
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
486
      }
487
      iprot.readFieldEnd();
488
    }
489
    iprot.readStructEnd();
490
    validate();
491
  }
492
 
493
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
494
    validate();
495
 
496
    oprot.writeStructBegin(STRUCT_DESC);
497
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
498
    oprot.writeI64(this.item_id);
499
    oprot.writeFieldEnd();
500
    oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
501
    oprot.writeI64(this.warehouse_id);
502
    oprot.writeFieldEnd();
503
    oprot.writeFieldBegin(HELD_FIELD_DESC);
504
    oprot.writeI64(this.held);
505
    oprot.writeFieldEnd();
506
    oprot.writeFieldBegin(SOURCE_FIELD_DESC);
507
    oprot.writeI64(this.source);
508
    oprot.writeFieldEnd();
509
    oprot.writeFieldStop();
510
    oprot.writeStructEnd();
511
  }
512
 
513
  @Override
514
  public String toString() {
515
    StringBuilder sb = new StringBuilder("HoldInventoryDetail(");
516
    boolean first = true;
517
 
518
    sb.append("item_id:");
519
    sb.append(this.item_id);
520
    first = false;
521
    if (!first) sb.append(", ");
522
    sb.append("warehouse_id:");
523
    sb.append(this.warehouse_id);
524
    first = false;
525
    if (!first) sb.append(", ");
526
    sb.append("held:");
527
    sb.append(this.held);
528
    first = false;
529
    if (!first) sb.append(", ");
530
    sb.append("source:");
531
    sb.append(this.source);
532
    first = false;
533
    sb.append(")");
534
    return sb.toString();
535
  }
536
 
537
  public void validate() throws org.apache.thrift.TException {
538
    // check for required fields
539
  }
540
 
541
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
542
    try {
543
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
544
    } catch (org.apache.thrift.TException te) {
545
      throw new java.io.IOException(te);
546
    }
547
  }
548
 
549
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
550
    try {
551
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
552
      __isset_bit_vector = new BitSet(1);
553
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
554
    } catch (org.apache.thrift.TException te) {
555
      throw new java.io.IOException(te);
556
    }
557
  }
558
 
559
}
560