Subversion Repositories SmartDukaan

Rev

Rev 3430 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2820 chandransh 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
2820 chandransh 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.warehouse;
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;
3430 rajveer 18
import java.nio.ByteBuffer;
2820 chandransh 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
3430 rajveer 23
public class Scan implements org.apache.thrift.TBase<Scan, Scan._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Scan");
2820 chandransh 25
 
3430 rajveer 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);
4496 mandeep.dh 27
  private static final org.apache.thrift.protocol.TField INVENTORY_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("inventoryItemId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)6);
32
  private static final org.apache.thrift.protocol.TField SCANNED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("scannedAt", org.apache.thrift.protocol.TType.I64, (short)7);
2820 chandransh 33
 
3430 rajveer 34
  private long id; // required
4496 mandeep.dh 35
  private long inventoryItemId; // required
36
  private long quantity; // required
37
  private long orderId; // required
3430 rajveer 38
  private long warehouseId; // required
39
  private ScanType type; // required
40
  private long scannedAt; // required
2820 chandransh 41
 
42
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 43
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2820 chandransh 44
    ID((short)1, "id"),
4496 mandeep.dh 45
    INVENTORY_ITEM_ID((short)2, "inventoryItemId"),
46
    QUANTITY((short)3, "quantity"),
47
    ORDER_ID((short)4, "orderId"),
48
    WAREHOUSE_ID((short)5, "warehouseId"),
2820 chandransh 49
    /**
50
     * 
51
     * @see ScanType
52
     */
4496 mandeep.dh 53
    TYPE((short)6, "type"),
54
    SCANNED_AT((short)7, "scannedAt");
2820 chandransh 55
 
56
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
57
 
58
    static {
59
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
60
        byName.put(field.getFieldName(), field);
61
      }
62
    }
63
 
64
    /**
65
     * Find the _Fields constant that matches fieldId, or null if its not found.
66
     */
67
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 68
      switch(fieldId) {
69
        case 1: // ID
70
          return ID;
4496 mandeep.dh 71
        case 2: // INVENTORY_ITEM_ID
72
          return INVENTORY_ITEM_ID;
73
        case 3: // QUANTITY
74
          return QUANTITY;
75
        case 4: // ORDER_ID
76
          return ORDER_ID;
77
        case 5: // WAREHOUSE_ID
3430 rajveer 78
          return WAREHOUSE_ID;
4496 mandeep.dh 79
        case 6: // TYPE
3430 rajveer 80
          return TYPE;
4496 mandeep.dh 81
        case 7: // SCANNED_AT
3430 rajveer 82
          return SCANNED_AT;
83
        default:
84
          return null;
85
      }
2820 chandransh 86
    }
87
 
88
    /**
89
     * Find the _Fields constant that matches fieldId, throwing an exception
90
     * if it is not found.
91
     */
92
    public static _Fields findByThriftIdOrThrow(int fieldId) {
93
      _Fields fields = findByThriftId(fieldId);
94
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
95
      return fields;
96
    }
97
 
98
    /**
99
     * Find the _Fields constant that matches name, or null if its not found.
100
     */
101
    public static _Fields findByName(String name) {
102
      return byName.get(name);
103
    }
104
 
105
    private final short _thriftId;
106
    private final String _fieldName;
107
 
108
    _Fields(short thriftId, String fieldName) {
109
      _thriftId = thriftId;
110
      _fieldName = fieldName;
111
    }
112
 
113
    public short getThriftFieldId() {
114
      return _thriftId;
115
    }
116
 
117
    public String getFieldName() {
118
      return _fieldName;
119
    }
120
  }
121
 
122
  // isset id assignments
123
  private static final int __ID_ISSET_ID = 0;
4496 mandeep.dh 124
  private static final int __INVENTORYITEMID_ISSET_ID = 1;
125
  private static final int __QUANTITY_ISSET_ID = 2;
126
  private static final int __ORDERID_ISSET_ID = 3;
127
  private static final int __WAREHOUSEID_ISSET_ID = 4;
128
  private static final int __SCANNEDAT_ISSET_ID = 5;
129
  private BitSet __isset_bit_vector = new BitSet(6);
2820 chandransh 130
 
3430 rajveer 131
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2820 chandransh 132
  static {
3430 rajveer 133
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
134
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4496 mandeep.dh 136
    tmpMap.put(_Fields.INVENTORY_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("inventoryItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3430 rajveer 137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
4496 mandeep.dh 138
    tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
140
    tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
141
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3430 rajveer 142
    tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
144
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScanType.class)));
146
    tmpMap.put(_Fields.SCANNED_AT, new org.apache.thrift.meta_data.FieldMetaData("scannedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
148
    metaDataMap = Collections.unmodifiableMap(tmpMap);
149
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Scan.class, metaDataMap);
2820 chandransh 150
  }
151
 
152
  public Scan() {
153
  }
154
 
155
  public Scan(
156
    long id,
4496 mandeep.dh 157
    long inventoryItemId,
3383 chandransh 158
    long warehouseId,
2820 chandransh 159
    ScanType type,
160
    long scannedAt)
161
  {
162
    this();
163
    this.id = id;
164
    setIdIsSet(true);
4496 mandeep.dh 165
    this.inventoryItemId = inventoryItemId;
166
    setInventoryItemIdIsSet(true);
3383 chandransh 167
    this.warehouseId = warehouseId;
168
    setWarehouseIdIsSet(true);
2820 chandransh 169
    this.type = type;
170
    this.scannedAt = scannedAt;
171
    setScannedAtIsSet(true);
172
  }
173
 
174
  /**
175
   * Performs a deep copy on <i>other</i>.
176
   */
177
  public Scan(Scan other) {
178
    __isset_bit_vector.clear();
179
    __isset_bit_vector.or(other.__isset_bit_vector);
180
    this.id = other.id;
4496 mandeep.dh 181
    this.inventoryItemId = other.inventoryItemId;
182
    this.quantity = other.quantity;
183
    this.orderId = other.orderId;
3383 chandransh 184
    this.warehouseId = other.warehouseId;
2820 chandransh 185
    if (other.isSetType()) {
186
      this.type = other.type;
187
    }
188
    this.scannedAt = other.scannedAt;
189
  }
190
 
191
  public Scan deepCopy() {
192
    return new Scan(this);
193
  }
194
 
3430 rajveer 195
  @Override
196
  public void clear() {
197
    setIdIsSet(false);
198
    this.id = 0;
4496 mandeep.dh 199
    setInventoryItemIdIsSet(false);
200
    this.inventoryItemId = 0;
201
    setQuantityIsSet(false);
202
    this.quantity = 0;
203
    setOrderIdIsSet(false);
204
    this.orderId = 0;
3430 rajveer 205
    setWarehouseIdIsSet(false);
206
    this.warehouseId = 0;
207
    this.type = null;
208
    setScannedAtIsSet(false);
209
    this.scannedAt = 0;
2820 chandransh 210
  }
211
 
212
  public long getId() {
213
    return this.id;
214
  }
215
 
3430 rajveer 216
  public void setId(long id) {
2820 chandransh 217
    this.id = id;
218
    setIdIsSet(true);
219
  }
220
 
221
  public void unsetId() {
222
    __isset_bit_vector.clear(__ID_ISSET_ID);
223
  }
224
 
3430 rajveer 225
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
2820 chandransh 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
 
4496 mandeep.dh 234
  public long getInventoryItemId() {
235
    return this.inventoryItemId;
2820 chandransh 236
  }
237
 
4496 mandeep.dh 238
  public void setInventoryItemId(long inventoryItemId) {
239
    this.inventoryItemId = inventoryItemId;
240
    setInventoryItemIdIsSet(true);
2820 chandransh 241
  }
242
 
4496 mandeep.dh 243
  public void unsetInventoryItemId() {
244
    __isset_bit_vector.clear(__INVENTORYITEMID_ISSET_ID);
2820 chandransh 245
  }
246
 
4496 mandeep.dh 247
  /** Returns true if field inventoryItemId is set (has been assigned a value) and false otherwise */
248
  public boolean isSetInventoryItemId() {
249
    return __isset_bit_vector.get(__INVENTORYITEMID_ISSET_ID);
2820 chandransh 250
  }
251
 
4496 mandeep.dh 252
  public void setInventoryItemIdIsSet(boolean value) {
253
    __isset_bit_vector.set(__INVENTORYITEMID_ISSET_ID, value);
2820 chandransh 254
  }
255
 
4496 mandeep.dh 256
  public long getQuantity() {
257
    return this.quantity;
2820 chandransh 258
  }
259
 
4496 mandeep.dh 260
  public void setQuantity(long quantity) {
261
    this.quantity = quantity;
262
    setQuantityIsSet(true);
2820 chandransh 263
  }
264
 
4496 mandeep.dh 265
  public void unsetQuantity() {
266
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
2820 chandransh 267
  }
268
 
4496 mandeep.dh 269
  /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
270
  public boolean isSetQuantity() {
271
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
2820 chandransh 272
  }
273
 
4496 mandeep.dh 274
  public void setQuantityIsSet(boolean value) {
275
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
2820 chandransh 276
  }
277
 
4496 mandeep.dh 278
  public long getOrderId() {
279
    return this.orderId;
3383 chandransh 280
  }
281
 
4496 mandeep.dh 282
  public void setOrderId(long orderId) {
283
    this.orderId = orderId;
284
    setOrderIdIsSet(true);
3383 chandransh 285
  }
286
 
4496 mandeep.dh 287
  public void unsetOrderId() {
288
    __isset_bit_vector.clear(__ORDERID_ISSET_ID);
3383 chandransh 289
  }
290
 
4496 mandeep.dh 291
  /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
292
  public boolean isSetOrderId() {
293
    return __isset_bit_vector.get(__ORDERID_ISSET_ID);
3383 chandransh 294
  }
295
 
4496 mandeep.dh 296
  public void setOrderIdIsSet(boolean value) {
297
    __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
3383 chandransh 298
  }
299
 
4496 mandeep.dh 300
  public long getWarehouseId() {
301
    return this.warehouseId;
3383 chandransh 302
  }
303
 
4496 mandeep.dh 304
  public void setWarehouseId(long warehouseId) {
305
    this.warehouseId = warehouseId;
306
    setWarehouseIdIsSet(true);
3383 chandransh 307
  }
308
 
4496 mandeep.dh 309
  public void unsetWarehouseId() {
310
    __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
3383 chandransh 311
  }
312
 
4496 mandeep.dh 313
  /** Returns true if field warehouseId is set (has been assigned a value) and false otherwise */
314
  public boolean isSetWarehouseId() {
315
    return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
3383 chandransh 316
  }
317
 
4496 mandeep.dh 318
  public void setWarehouseIdIsSet(boolean value) {
319
    __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
3383 chandransh 320
  }
321
 
2820 chandransh 322
  /**
323
   * 
324
   * @see ScanType
325
   */
326
  public ScanType getType() {
327
    return this.type;
328
  }
329
 
330
  /**
331
   * 
332
   * @see ScanType
333
   */
3430 rajveer 334
  public void setType(ScanType type) {
2820 chandransh 335
    this.type = type;
336
  }
337
 
338
  public void unsetType() {
339
    this.type = null;
340
  }
341
 
3430 rajveer 342
  /** Returns true if field type is set (has been assigned a value) and false otherwise */
2820 chandransh 343
  public boolean isSetType() {
344
    return this.type != null;
345
  }
346
 
347
  public void setTypeIsSet(boolean value) {
348
    if (!value) {
349
      this.type = null;
350
    }
351
  }
352
 
353
  public long getScannedAt() {
354
    return this.scannedAt;
355
  }
356
 
3430 rajveer 357
  public void setScannedAt(long scannedAt) {
2820 chandransh 358
    this.scannedAt = scannedAt;
359
    setScannedAtIsSet(true);
360
  }
361
 
362
  public void unsetScannedAt() {
363
    __isset_bit_vector.clear(__SCANNEDAT_ISSET_ID);
364
  }
365
 
3430 rajveer 366
  /** Returns true if field scannedAt is set (has been assigned a value) and false otherwise */
2820 chandransh 367
  public boolean isSetScannedAt() {
368
    return __isset_bit_vector.get(__SCANNEDAT_ISSET_ID);
369
  }
370
 
371
  public void setScannedAtIsSet(boolean value) {
372
    __isset_bit_vector.set(__SCANNEDAT_ISSET_ID, value);
373
  }
374
 
375
  public void setFieldValue(_Fields field, Object value) {
376
    switch (field) {
377
    case ID:
378
      if (value == null) {
379
        unsetId();
380
      } else {
381
        setId((Long)value);
382
      }
383
      break;
384
 
4496 mandeep.dh 385
    case INVENTORY_ITEM_ID:
2820 chandransh 386
      if (value == null) {
4496 mandeep.dh 387
        unsetInventoryItemId();
2820 chandransh 388
      } else {
4496 mandeep.dh 389
        setInventoryItemId((Long)value);
2820 chandransh 390
      }
391
      break;
392
 
4496 mandeep.dh 393
    case QUANTITY:
2820 chandransh 394
      if (value == null) {
4496 mandeep.dh 395
        unsetQuantity();
2820 chandransh 396
      } else {
4496 mandeep.dh 397
        setQuantity((Long)value);
2820 chandransh 398
      }
399
      break;
400
 
4496 mandeep.dh 401
    case ORDER_ID:
3383 chandransh 402
      if (value == null) {
4496 mandeep.dh 403
        unsetOrderId();
3383 chandransh 404
      } else {
4496 mandeep.dh 405
        setOrderId((Long)value);
3383 chandransh 406
      }
407
      break;
408
 
4496 mandeep.dh 409
    case WAREHOUSE_ID:
3383 chandransh 410
      if (value == null) {
4496 mandeep.dh 411
        unsetWarehouseId();
3383 chandransh 412
      } else {
4496 mandeep.dh 413
        setWarehouseId((Long)value);
3383 chandransh 414
      }
415
      break;
416
 
2820 chandransh 417
    case TYPE:
418
      if (value == null) {
419
        unsetType();
420
      } else {
421
        setType((ScanType)value);
422
      }
423
      break;
424
 
425
    case SCANNED_AT:
426
      if (value == null) {
427
        unsetScannedAt();
428
      } else {
429
        setScannedAt((Long)value);
430
      }
431
      break;
432
 
433
    }
434
  }
435
 
436
  public Object getFieldValue(_Fields field) {
437
    switch (field) {
438
    case ID:
3430 rajveer 439
      return Long.valueOf(getId());
2820 chandransh 440
 
4496 mandeep.dh 441
    case INVENTORY_ITEM_ID:
442
      return Long.valueOf(getInventoryItemId());
2820 chandransh 443
 
4496 mandeep.dh 444
    case QUANTITY:
445
      return Long.valueOf(getQuantity());
446
 
447
    case ORDER_ID:
448
      return Long.valueOf(getOrderId());
449
 
3383 chandransh 450
    case WAREHOUSE_ID:
3430 rajveer 451
      return Long.valueOf(getWarehouseId());
2820 chandransh 452
 
453
    case TYPE:
454
      return getType();
455
 
456
    case SCANNED_AT:
3430 rajveer 457
      return Long.valueOf(getScannedAt());
2820 chandransh 458
 
459
    }
460
    throw new IllegalStateException();
461
  }
462
 
3430 rajveer 463
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
464
  public boolean isSet(_Fields field) {
465
    if (field == null) {
466
      throw new IllegalArgumentException();
467
    }
2820 chandransh 468
 
469
    switch (field) {
470
    case ID:
471
      return isSetId();
4496 mandeep.dh 472
    case INVENTORY_ITEM_ID:
473
      return isSetInventoryItemId();
474
    case QUANTITY:
475
      return isSetQuantity();
476
    case ORDER_ID:
477
      return isSetOrderId();
3383 chandransh 478
    case WAREHOUSE_ID:
479
      return isSetWarehouseId();
2820 chandransh 480
    case TYPE:
481
      return isSetType();
482
    case SCANNED_AT:
483
      return isSetScannedAt();
484
    }
485
    throw new IllegalStateException();
486
  }
487
 
488
  @Override
489
  public boolean equals(Object that) {
490
    if (that == null)
491
      return false;
492
    if (that instanceof Scan)
493
      return this.equals((Scan)that);
494
    return false;
495
  }
496
 
497
  public boolean equals(Scan that) {
498
    if (that == null)
499
      return false;
500
 
501
    boolean this_present_id = true;
502
    boolean that_present_id = true;
503
    if (this_present_id || that_present_id) {
504
      if (!(this_present_id && that_present_id))
505
        return false;
506
      if (this.id != that.id)
507
        return false;
508
    }
509
 
4496 mandeep.dh 510
    boolean this_present_inventoryItemId = true;
511
    boolean that_present_inventoryItemId = true;
512
    if (this_present_inventoryItemId || that_present_inventoryItemId) {
513
      if (!(this_present_inventoryItemId && that_present_inventoryItemId))
2820 chandransh 514
        return false;
4496 mandeep.dh 515
      if (this.inventoryItemId != that.inventoryItemId)
2820 chandransh 516
        return false;
517
    }
518
 
4496 mandeep.dh 519
    boolean this_present_quantity = true && this.isSetQuantity();
520
    boolean that_present_quantity = true && that.isSetQuantity();
521
    if (this_present_quantity || that_present_quantity) {
522
      if (!(this_present_quantity && that_present_quantity))
2820 chandransh 523
        return false;
4496 mandeep.dh 524
      if (this.quantity != that.quantity)
2820 chandransh 525
        return false;
526
    }
527
 
4496 mandeep.dh 528
    boolean this_present_orderId = true && this.isSetOrderId();
529
    boolean that_present_orderId = true && that.isSetOrderId();
530
    if (this_present_orderId || that_present_orderId) {
531
      if (!(this_present_orderId && that_present_orderId))
3383 chandransh 532
        return false;
4496 mandeep.dh 533
      if (this.orderId != that.orderId)
3383 chandransh 534
        return false;
535
    }
536
 
4496 mandeep.dh 537
    boolean this_present_warehouseId = true;
538
    boolean that_present_warehouseId = true;
539
    if (this_present_warehouseId || that_present_warehouseId) {
540
      if (!(this_present_warehouseId && that_present_warehouseId))
3383 chandransh 541
        return false;
4496 mandeep.dh 542
      if (this.warehouseId != that.warehouseId)
3383 chandransh 543
        return false;
544
    }
545
 
2820 chandransh 546
    boolean this_present_type = true && this.isSetType();
547
    boolean that_present_type = true && that.isSetType();
548
    if (this_present_type || that_present_type) {
549
      if (!(this_present_type && that_present_type))
550
        return false;
551
      if (!this.type.equals(that.type))
552
        return false;
553
    }
554
 
555
    boolean this_present_scannedAt = true;
556
    boolean that_present_scannedAt = true;
557
    if (this_present_scannedAt || that_present_scannedAt) {
558
      if (!(this_present_scannedAt && that_present_scannedAt))
559
        return false;
560
      if (this.scannedAt != that.scannedAt)
561
        return false;
562
    }
563
 
564
    return true;
565
  }
566
 
567
  @Override
568
  public int hashCode() {
569
    return 0;
570
  }
571
 
572
  public int compareTo(Scan other) {
573
    if (!getClass().equals(other.getClass())) {
574
      return getClass().getName().compareTo(other.getClass().getName());
575
    }
576
 
577
    int lastComparison = 0;
578
    Scan typedOther = (Scan)other;
579
 
3430 rajveer 580
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
2820 chandransh 581
    if (lastComparison != 0) {
582
      return lastComparison;
583
    }
3430 rajveer 584
    if (isSetId()) {
585
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
586
      if (lastComparison != 0) {
587
        return lastComparison;
588
      }
2820 chandransh 589
    }
4496 mandeep.dh 590
    lastComparison = Boolean.valueOf(isSetInventoryItemId()).compareTo(typedOther.isSetInventoryItemId());
2820 chandransh 591
    if (lastComparison != 0) {
592
      return lastComparison;
593
    }
4496 mandeep.dh 594
    if (isSetInventoryItemId()) {
595
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inventoryItemId, typedOther.inventoryItemId);
3430 rajveer 596
      if (lastComparison != 0) {
597
        return lastComparison;
598
      }
2820 chandransh 599
    }
4496 mandeep.dh 600
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
2820 chandransh 601
    if (lastComparison != 0) {
602
      return lastComparison;
603
    }
4496 mandeep.dh 604
    if (isSetQuantity()) {
605
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
3430 rajveer 606
      if (lastComparison != 0) {
607
        return lastComparison;
608
      }
2820 chandransh 609
    }
4496 mandeep.dh 610
    lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
3383 chandransh 611
    if (lastComparison != 0) {
612
      return lastComparison;
613
    }
4496 mandeep.dh 614
    if (isSetOrderId()) {
615
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
3430 rajveer 616
      if (lastComparison != 0) {
617
        return lastComparison;
618
      }
3383 chandransh 619
    }
4496 mandeep.dh 620
    lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
3383 chandransh 621
    if (lastComparison != 0) {
622
      return lastComparison;
623
    }
4496 mandeep.dh 624
    if (isSetWarehouseId()) {
625
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
3430 rajveer 626
      if (lastComparison != 0) {
627
        return lastComparison;
628
      }
3383 chandransh 629
    }
3430 rajveer 630
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
2820 chandransh 631
    if (lastComparison != 0) {
632
      return lastComparison;
633
    }
3430 rajveer 634
    if (isSetType()) {
635
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
636
      if (lastComparison != 0) {
637
        return lastComparison;
638
      }
2820 chandransh 639
    }
3430 rajveer 640
    lastComparison = Boolean.valueOf(isSetScannedAt()).compareTo(typedOther.isSetScannedAt());
2820 chandransh 641
    if (lastComparison != 0) {
642
      return lastComparison;
643
    }
3430 rajveer 644
    if (isSetScannedAt()) {
645
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scannedAt, typedOther.scannedAt);
646
      if (lastComparison != 0) {
647
        return lastComparison;
648
      }
2820 chandransh 649
    }
650
    return 0;
651
  }
652
 
3430 rajveer 653
  public _Fields fieldForId(int fieldId) {
654
    return _Fields.findByThriftId(fieldId);
655
  }
656
 
657
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
658
    org.apache.thrift.protocol.TField field;
2820 chandransh 659
    iprot.readStructBegin();
660
    while (true)
661
    {
662
      field = iprot.readFieldBegin();
3430 rajveer 663
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
2820 chandransh 664
        break;
665
      }
3430 rajveer 666
      switch (field.id) {
667
        case 1: // ID
668
          if (field.type == org.apache.thrift.protocol.TType.I64) {
669
            this.id = iprot.readI64();
670
            setIdIsSet(true);
671
          } else { 
672
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
673
          }
674
          break;
4496 mandeep.dh 675
        case 2: // INVENTORY_ITEM_ID
3430 rajveer 676
          if (field.type == org.apache.thrift.protocol.TType.I64) {
4496 mandeep.dh 677
            this.inventoryItemId = iprot.readI64();
678
            setInventoryItemIdIsSet(true);
3430 rajveer 679
          } else { 
680
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
681
          }
682
          break;
4496 mandeep.dh 683
        case 3: // QUANTITY
3430 rajveer 684
          if (field.type == org.apache.thrift.protocol.TType.I64) {
4496 mandeep.dh 685
            this.quantity = iprot.readI64();
686
            setQuantityIsSet(true);
3430 rajveer 687
          } else { 
688
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
689
          }
690
          break;
4496 mandeep.dh 691
        case 4: // ORDER_ID
3430 rajveer 692
          if (field.type == org.apache.thrift.protocol.TType.I64) {
4496 mandeep.dh 693
            this.orderId = iprot.readI64();
694
            setOrderIdIsSet(true);
3430 rajveer 695
          } else { 
696
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
697
          }
698
          break;
4496 mandeep.dh 699
        case 5: // WAREHOUSE_ID
700
          if (field.type == org.apache.thrift.protocol.TType.I64) {
701
            this.warehouseId = iprot.readI64();
702
            setWarehouseIdIsSet(true);
3430 rajveer 703
          } else { 
704
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
705
          }
706
          break;
4496 mandeep.dh 707
        case 6: // TYPE
3430 rajveer 708
          if (field.type == org.apache.thrift.protocol.TType.I32) {
709
            this.type = ScanType.findByValue(iprot.readI32());
710
          } else { 
711
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
712
          }
713
          break;
4496 mandeep.dh 714
        case 7: // SCANNED_AT
3430 rajveer 715
          if (field.type == org.apache.thrift.protocol.TType.I64) {
716
            this.scannedAt = iprot.readI64();
717
            setScannedAtIsSet(true);
718
          } else { 
719
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
720
          }
721
          break;
722
        default:
723
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2820 chandransh 724
      }
3430 rajveer 725
      iprot.readFieldEnd();
2820 chandransh 726
    }
727
    iprot.readStructEnd();
728
    validate();
729
  }
730
 
3430 rajveer 731
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
2820 chandransh 732
    validate();
733
 
734
    oprot.writeStructBegin(STRUCT_DESC);
735
    oprot.writeFieldBegin(ID_FIELD_DESC);
736
    oprot.writeI64(this.id);
737
    oprot.writeFieldEnd();
4496 mandeep.dh 738
    oprot.writeFieldBegin(INVENTORY_ITEM_ID_FIELD_DESC);
739
    oprot.writeI64(this.inventoryItemId);
2820 chandransh 740
    oprot.writeFieldEnd();
4496 mandeep.dh 741
    if (isSetQuantity()) {
742
      oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
743
      oprot.writeI64(this.quantity);
3383 chandransh 744
      oprot.writeFieldEnd();
745
    }
4496 mandeep.dh 746
    if (isSetOrderId()) {
747
      oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
748
      oprot.writeI64(this.orderId);
3383 chandransh 749
      oprot.writeFieldEnd();
750
    }
4496 mandeep.dh 751
    oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
752
    oprot.writeI64(this.warehouseId);
753
    oprot.writeFieldEnd();
2820 chandransh 754
    if (this.type != null) {
755
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
756
      oprot.writeI32(this.type.getValue());
757
      oprot.writeFieldEnd();
758
    }
759
    oprot.writeFieldBegin(SCANNED_AT_FIELD_DESC);
760
    oprot.writeI64(this.scannedAt);
761
    oprot.writeFieldEnd();
762
    oprot.writeFieldStop();
763
    oprot.writeStructEnd();
764
  }
765
 
766
  @Override
767
  public String toString() {
768
    StringBuilder sb = new StringBuilder("Scan(");
769
    boolean first = true;
770
 
771
    sb.append("id:");
772
    sb.append(this.id);
773
    first = false;
774
    if (!first) sb.append(", ");
4496 mandeep.dh 775
    sb.append("inventoryItemId:");
776
    sb.append(this.inventoryItemId);
2820 chandransh 777
    first = false;
4496 mandeep.dh 778
    if (isSetQuantity()) {
779
      if (!first) sb.append(", ");
780
      sb.append("quantity:");
781
      sb.append(this.quantity);
782
      first = false;
783
    }
784
    if (isSetOrderId()) {
785
      if (!first) sb.append(", ");
786
      sb.append("orderId:");
787
      sb.append(this.orderId);
788
      first = false;
789
    }
2820 chandransh 790
    if (!first) sb.append(", ");
3383 chandransh 791
    sb.append("warehouseId:");
792
    sb.append(this.warehouseId);
2820 chandransh 793
    first = false;
794
    if (!first) sb.append(", ");
795
    sb.append("type:");
796
    if (this.type == null) {
797
      sb.append("null");
798
    } else {
799
      sb.append(this.type);
800
    }
801
    first = false;
802
    if (!first) sb.append(", ");
803
    sb.append("scannedAt:");
804
    sb.append(this.scannedAt);
805
    first = false;
806
    sb.append(")");
807
    return sb.toString();
808
  }
809
 
3430 rajveer 810
  public void validate() throws org.apache.thrift.TException {
2820 chandransh 811
    // check for required fields
812
  }
813
 
3430 rajveer 814
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
815
    try {
816
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
817
    } catch (org.apache.thrift.TException te) {
818
      throw new java.io.IOException(te);
819
    }
820
  }
821
 
822
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
823
    try {
824
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
825
      __isset_bit_vector = new BitSet(1);
826
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
827
    } catch (org.apache.thrift.TException te) {
828
      throw new java.io.IOException(te);
829
    }
830
  }
831
 
2820 chandransh 832
}
833