Subversion Repositories SmartDukaan

Rev

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