Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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