Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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