Subversion Repositories SmartDukaan

Rev

Rev 5545 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5372 mandeep.dh 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 DetailedPurchaseScan implements org.apache.thrift.TBase<DetailedPurchaseScan, DetailedPurchaseScan._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DetailedPurchaseScan");
25
 
26
  private static final org.apache.thrift.protocol.TField PURCHASE_ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("purchaseOrderId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField PO_CREATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("poCreatedAt", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField SUPPLIER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("supplierName", org.apache.thrift.protocol.TType.STRING, (short)3);
29
  private static final org.apache.thrift.protocol.TField INVOICE_NUMBERS_FIELD_DESC = new org.apache.thrift.protocol.TField("invoiceNumbers", org.apache.thrift.protocol.TType.STRING, (short)4);
30
  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)5);
31
  private static final org.apache.thrift.protocol.TField ITEM_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("itemName", org.apache.thrift.protocol.TType.STRING, (short)6);
32
  private static final org.apache.thrift.protocol.TField UNIT_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("unitPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
33
  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)8);
34
 
35
  private long purchaseOrderId; // required
36
  private long poCreatedAt; // required
37
  private String supplierName; // required
38
  private String invoiceNumbers; // required
39
  private long itemId; // required
40
  private String itemName; // required
41
  private double unitPrice; // required
42
  private long quantity; // 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
    PURCHASE_ORDER_ID((short)1, "purchaseOrderId"),
47
    PO_CREATED_AT((short)2, "poCreatedAt"),
48
    SUPPLIER_NAME((short)3, "supplierName"),
49
    INVOICE_NUMBERS((short)4, "invoiceNumbers"),
50
    ITEM_ID((short)5, "itemId"),
51
    ITEM_NAME((short)6, "itemName"),
52
    UNIT_PRICE((short)7, "unitPrice"),
53
    QUANTITY((short)8, "quantity");
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: // PURCHASE_ORDER_ID
69
          return PURCHASE_ORDER_ID;
70
        case 2: // PO_CREATED_AT
71
          return PO_CREATED_AT;
72
        case 3: // SUPPLIER_NAME
73
          return SUPPLIER_NAME;
74
        case 4: // INVOICE_NUMBERS
75
          return INVOICE_NUMBERS;
76
        case 5: // ITEM_ID
77
          return ITEM_ID;
78
        case 6: // ITEM_NAME
79
          return ITEM_NAME;
80
        case 7: // UNIT_PRICE
81
          return UNIT_PRICE;
82
        case 8: // QUANTITY
83
          return QUANTITY;
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 __PURCHASEORDERID_ISSET_ID = 0;
125
  private static final int __POCREATEDAT_ISSET_ID = 1;
126
  private static final int __ITEMID_ISSET_ID = 2;
127
  private static final int __UNITPRICE_ISSET_ID = 3;
128
  private static final int __QUANTITY_ISSET_ID = 4;
129
  private BitSet __isset_bit_vector = new BitSet(5);
130
 
131
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
132
  static {
133
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
134
    tmpMap.put(_Fields.PURCHASE_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
136
    tmpMap.put(_Fields.PO_CREATED_AT, new org.apache.thrift.meta_data.FieldMetaData("poCreatedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
138
    tmpMap.put(_Fields.SUPPLIER_NAME, new org.apache.thrift.meta_data.FieldMetaData("supplierName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
140
    tmpMap.put(_Fields.INVOICE_NUMBERS, new org.apache.thrift.meta_data.FieldMetaData("invoiceNumbers", org.apache.thrift.TFieldRequirementType.DEFAULT, 
141
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
142
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
144
    tmpMap.put(_Fields.ITEM_NAME, new org.apache.thrift.meta_data.FieldMetaData("itemName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
146
    tmpMap.put(_Fields.UNIT_PRICE, new org.apache.thrift.meta_data.FieldMetaData("unitPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
148
    tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
150
    metaDataMap = Collections.unmodifiableMap(tmpMap);
151
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DetailedPurchaseScan.class, metaDataMap);
152
  }
153
 
154
  public DetailedPurchaseScan() {
155
  }
156
 
157
  public DetailedPurchaseScan(
158
    long purchaseOrderId,
159
    long poCreatedAt,
160
    String supplierName,
161
    String invoiceNumbers,
162
    long itemId,
163
    String itemName,
164
    double unitPrice,
165
    long quantity)
166
  {
167
    this();
168
    this.purchaseOrderId = purchaseOrderId;
169
    setPurchaseOrderIdIsSet(true);
170
    this.poCreatedAt = poCreatedAt;
171
    setPoCreatedAtIsSet(true);
172
    this.supplierName = supplierName;
173
    this.invoiceNumbers = invoiceNumbers;
174
    this.itemId = itemId;
175
    setItemIdIsSet(true);
176
    this.itemName = itemName;
177
    this.unitPrice = unitPrice;
178
    setUnitPriceIsSet(true);
179
    this.quantity = quantity;
180
    setQuantityIsSet(true);
181
  }
182
 
183
  /**
184
   * Performs a deep copy on <i>other</i>.
185
   */
186
  public DetailedPurchaseScan(DetailedPurchaseScan other) {
187
    __isset_bit_vector.clear();
188
    __isset_bit_vector.or(other.__isset_bit_vector);
189
    this.purchaseOrderId = other.purchaseOrderId;
190
    this.poCreatedAt = other.poCreatedAt;
191
    if (other.isSetSupplierName()) {
192
      this.supplierName = other.supplierName;
193
    }
194
    if (other.isSetInvoiceNumbers()) {
195
      this.invoiceNumbers = other.invoiceNumbers;
196
    }
197
    this.itemId = other.itemId;
198
    if (other.isSetItemName()) {
199
      this.itemName = other.itemName;
200
    }
201
    this.unitPrice = other.unitPrice;
202
    this.quantity = other.quantity;
203
  }
204
 
205
  public DetailedPurchaseScan deepCopy() {
206
    return new DetailedPurchaseScan(this);
207
  }
208
 
209
  @Override
210
  public void clear() {
211
    setPurchaseOrderIdIsSet(false);
212
    this.purchaseOrderId = 0;
213
    setPoCreatedAtIsSet(false);
214
    this.poCreatedAt = 0;
215
    this.supplierName = null;
216
    this.invoiceNumbers = null;
217
    setItemIdIsSet(false);
218
    this.itemId = 0;
219
    this.itemName = null;
220
    setUnitPriceIsSet(false);
221
    this.unitPrice = 0.0;
222
    setQuantityIsSet(false);
223
    this.quantity = 0;
224
  }
225
 
226
  public long getPurchaseOrderId() {
227
    return this.purchaseOrderId;
228
  }
229
 
230
  public void setPurchaseOrderId(long purchaseOrderId) {
231
    this.purchaseOrderId = purchaseOrderId;
232
    setPurchaseOrderIdIsSet(true);
233
  }
234
 
235
  public void unsetPurchaseOrderId() {
236
    __isset_bit_vector.clear(__PURCHASEORDERID_ISSET_ID);
237
  }
238
 
239
  /** Returns true if field purchaseOrderId is set (has been assigned a value) and false otherwise */
240
  public boolean isSetPurchaseOrderId() {
241
    return __isset_bit_vector.get(__PURCHASEORDERID_ISSET_ID);
242
  }
243
 
244
  public void setPurchaseOrderIdIsSet(boolean value) {
245
    __isset_bit_vector.set(__PURCHASEORDERID_ISSET_ID, value);
246
  }
247
 
248
  public long getPoCreatedAt() {
249
    return this.poCreatedAt;
250
  }
251
 
252
  public void setPoCreatedAt(long poCreatedAt) {
253
    this.poCreatedAt = poCreatedAt;
254
    setPoCreatedAtIsSet(true);
255
  }
256
 
257
  public void unsetPoCreatedAt() {
258
    __isset_bit_vector.clear(__POCREATEDAT_ISSET_ID);
259
  }
260
 
261
  /** Returns true if field poCreatedAt is set (has been assigned a value) and false otherwise */
262
  public boolean isSetPoCreatedAt() {
263
    return __isset_bit_vector.get(__POCREATEDAT_ISSET_ID);
264
  }
265
 
266
  public void setPoCreatedAtIsSet(boolean value) {
267
    __isset_bit_vector.set(__POCREATEDAT_ISSET_ID, value);
268
  }
269
 
270
  public String getSupplierName() {
271
    return this.supplierName;
272
  }
273
 
274
  public void setSupplierName(String supplierName) {
275
    this.supplierName = supplierName;
276
  }
277
 
278
  public void unsetSupplierName() {
279
    this.supplierName = null;
280
  }
281
 
282
  /** Returns true if field supplierName is set (has been assigned a value) and false otherwise */
283
  public boolean isSetSupplierName() {
284
    return this.supplierName != null;
285
  }
286
 
287
  public void setSupplierNameIsSet(boolean value) {
288
    if (!value) {
289
      this.supplierName = null;
290
    }
291
  }
292
 
293
  public String getInvoiceNumbers() {
294
    return this.invoiceNumbers;
295
  }
296
 
297
  public void setInvoiceNumbers(String invoiceNumbers) {
298
    this.invoiceNumbers = invoiceNumbers;
299
  }
300
 
301
  public void unsetInvoiceNumbers() {
302
    this.invoiceNumbers = null;
303
  }
304
 
305
  /** Returns true if field invoiceNumbers is set (has been assigned a value) and false otherwise */
306
  public boolean isSetInvoiceNumbers() {
307
    return this.invoiceNumbers != null;
308
  }
309
 
310
  public void setInvoiceNumbersIsSet(boolean value) {
311
    if (!value) {
312
      this.invoiceNumbers = null;
313
    }
314
  }
315
 
316
  public long getItemId() {
317
    return this.itemId;
318
  }
319
 
320
  public void setItemId(long itemId) {
321
    this.itemId = itemId;
322
    setItemIdIsSet(true);
323
  }
324
 
325
  public void unsetItemId() {
326
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
327
  }
328
 
329
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
330
  public boolean isSetItemId() {
331
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
332
  }
333
 
334
  public void setItemIdIsSet(boolean value) {
335
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
336
  }
337
 
338
  public String getItemName() {
339
    return this.itemName;
340
  }
341
 
342
  public void setItemName(String itemName) {
343
    this.itemName = itemName;
344
  }
345
 
346
  public void unsetItemName() {
347
    this.itemName = null;
348
  }
349
 
350
  /** Returns true if field itemName is set (has been assigned a value) and false otherwise */
351
  public boolean isSetItemName() {
352
    return this.itemName != null;
353
  }
354
 
355
  public void setItemNameIsSet(boolean value) {
356
    if (!value) {
357
      this.itemName = null;
358
    }
359
  }
360
 
361
  public double getUnitPrice() {
362
    return this.unitPrice;
363
  }
364
 
365
  public void setUnitPrice(double unitPrice) {
366
    this.unitPrice = unitPrice;
367
    setUnitPriceIsSet(true);
368
  }
369
 
370
  public void unsetUnitPrice() {
371
    __isset_bit_vector.clear(__UNITPRICE_ISSET_ID);
372
  }
373
 
374
  /** Returns true if field unitPrice is set (has been assigned a value) and false otherwise */
375
  public boolean isSetUnitPrice() {
376
    return __isset_bit_vector.get(__UNITPRICE_ISSET_ID);
377
  }
378
 
379
  public void setUnitPriceIsSet(boolean value) {
380
    __isset_bit_vector.set(__UNITPRICE_ISSET_ID, value);
381
  }
382
 
383
  public long getQuantity() {
384
    return this.quantity;
385
  }
386
 
387
  public void setQuantity(long quantity) {
388
    this.quantity = quantity;
389
    setQuantityIsSet(true);
390
  }
391
 
392
  public void unsetQuantity() {
393
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
394
  }
395
 
396
  /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
397
  public boolean isSetQuantity() {
398
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
399
  }
400
 
401
  public void setQuantityIsSet(boolean value) {
402
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
403
  }
404
 
405
  public void setFieldValue(_Fields field, Object value) {
406
    switch (field) {
407
    case PURCHASE_ORDER_ID:
408
      if (value == null) {
409
        unsetPurchaseOrderId();
410
      } else {
411
        setPurchaseOrderId((Long)value);
412
      }
413
      break;
414
 
415
    case PO_CREATED_AT:
416
      if (value == null) {
417
        unsetPoCreatedAt();
418
      } else {
419
        setPoCreatedAt((Long)value);
420
      }
421
      break;
422
 
423
    case SUPPLIER_NAME:
424
      if (value == null) {
425
        unsetSupplierName();
426
      } else {
427
        setSupplierName((String)value);
428
      }
429
      break;
430
 
431
    case INVOICE_NUMBERS:
432
      if (value == null) {
433
        unsetInvoiceNumbers();
434
      } else {
435
        setInvoiceNumbers((String)value);
436
      }
437
      break;
438
 
439
    case ITEM_ID:
440
      if (value == null) {
441
        unsetItemId();
442
      } else {
443
        setItemId((Long)value);
444
      }
445
      break;
446
 
447
    case ITEM_NAME:
448
      if (value == null) {
449
        unsetItemName();
450
      } else {
451
        setItemName((String)value);
452
      }
453
      break;
454
 
455
    case UNIT_PRICE:
456
      if (value == null) {
457
        unsetUnitPrice();
458
      } else {
459
        setUnitPrice((Double)value);
460
      }
461
      break;
462
 
463
    case QUANTITY:
464
      if (value == null) {
465
        unsetQuantity();
466
      } else {
467
        setQuantity((Long)value);
468
      }
469
      break;
470
 
471
    }
472
  }
473
 
474
  public Object getFieldValue(_Fields field) {
475
    switch (field) {
476
    case PURCHASE_ORDER_ID:
477
      return Long.valueOf(getPurchaseOrderId());
478
 
479
    case PO_CREATED_AT:
480
      return Long.valueOf(getPoCreatedAt());
481
 
482
    case SUPPLIER_NAME:
483
      return getSupplierName();
484
 
485
    case INVOICE_NUMBERS:
486
      return getInvoiceNumbers();
487
 
488
    case ITEM_ID:
489
      return Long.valueOf(getItemId());
490
 
491
    case ITEM_NAME:
492
      return getItemName();
493
 
494
    case UNIT_PRICE:
495
      return Double.valueOf(getUnitPrice());
496
 
497
    case QUANTITY:
498
      return Long.valueOf(getQuantity());
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 PURCHASE_ORDER_ID:
512
      return isSetPurchaseOrderId();
513
    case PO_CREATED_AT:
514
      return isSetPoCreatedAt();
515
    case SUPPLIER_NAME:
516
      return isSetSupplierName();
517
    case INVOICE_NUMBERS:
518
      return isSetInvoiceNumbers();
519
    case ITEM_ID:
520
      return isSetItemId();
521
    case ITEM_NAME:
522
      return isSetItemName();
523
    case UNIT_PRICE:
524
      return isSetUnitPrice();
525
    case QUANTITY:
526
      return isSetQuantity();
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 DetailedPurchaseScan)
536
      return this.equals((DetailedPurchaseScan)that);
537
    return false;
538
  }
539
 
540
  public boolean equals(DetailedPurchaseScan that) {
541
    if (that == null)
542
      return false;
543
 
544
    boolean this_present_purchaseOrderId = true;
545
    boolean that_present_purchaseOrderId = true;
546
    if (this_present_purchaseOrderId || that_present_purchaseOrderId) {
547
      if (!(this_present_purchaseOrderId && that_present_purchaseOrderId))
548
        return false;
549
      if (this.purchaseOrderId != that.purchaseOrderId)
550
        return false;
551
    }
552
 
553
    boolean this_present_poCreatedAt = true;
554
    boolean that_present_poCreatedAt = true;
555
    if (this_present_poCreatedAt || that_present_poCreatedAt) {
556
      if (!(this_present_poCreatedAt && that_present_poCreatedAt))
557
        return false;
558
      if (this.poCreatedAt != that.poCreatedAt)
559
        return false;
560
    }
561
 
562
    boolean this_present_supplierName = true && this.isSetSupplierName();
563
    boolean that_present_supplierName = true && that.isSetSupplierName();
564
    if (this_present_supplierName || that_present_supplierName) {
565
      if (!(this_present_supplierName && that_present_supplierName))
566
        return false;
567
      if (!this.supplierName.equals(that.supplierName))
568
        return false;
569
    }
570
 
571
    boolean this_present_invoiceNumbers = true && this.isSetInvoiceNumbers();
572
    boolean that_present_invoiceNumbers = true && that.isSetInvoiceNumbers();
573
    if (this_present_invoiceNumbers || that_present_invoiceNumbers) {
574
      if (!(this_present_invoiceNumbers && that_present_invoiceNumbers))
575
        return false;
576
      if (!this.invoiceNumbers.equals(that.invoiceNumbers))
577
        return false;
578
    }
579
 
580
    boolean this_present_itemId = true;
581
    boolean that_present_itemId = true;
582
    if (this_present_itemId || that_present_itemId) {
583
      if (!(this_present_itemId && that_present_itemId))
584
        return false;
585
      if (this.itemId != that.itemId)
586
        return false;
587
    }
588
 
589
    boolean this_present_itemName = true && this.isSetItemName();
590
    boolean that_present_itemName = true && that.isSetItemName();
591
    if (this_present_itemName || that_present_itemName) {
592
      if (!(this_present_itemName && that_present_itemName))
593
        return false;
594
      if (!this.itemName.equals(that.itemName))
595
        return false;
596
    }
597
 
598
    boolean this_present_unitPrice = true;
599
    boolean that_present_unitPrice = true;
600
    if (this_present_unitPrice || that_present_unitPrice) {
601
      if (!(this_present_unitPrice && that_present_unitPrice))
602
        return false;
603
      if (this.unitPrice != that.unitPrice)
604
        return false;
605
    }
606
 
607
    boolean this_present_quantity = true;
608
    boolean that_present_quantity = true;
609
    if (this_present_quantity || that_present_quantity) {
610
      if (!(this_present_quantity && that_present_quantity))
611
        return false;
612
      if (this.quantity != that.quantity)
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(DetailedPurchaseScan other) {
625
    if (!getClass().equals(other.getClass())) {
626
      return getClass().getName().compareTo(other.getClass().getName());
627
    }
628
 
629
    int lastComparison = 0;
630
    DetailedPurchaseScan typedOther = (DetailedPurchaseScan)other;
631
 
632
    lastComparison = Boolean.valueOf(isSetPurchaseOrderId()).compareTo(typedOther.isSetPurchaseOrderId());
633
    if (lastComparison != 0) {
634
      return lastComparison;
635
    }
636
    if (isSetPurchaseOrderId()) {
637
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrderId, typedOther.purchaseOrderId);
638
      if (lastComparison != 0) {
639
        return lastComparison;
640
      }
641
    }
642
    lastComparison = Boolean.valueOf(isSetPoCreatedAt()).compareTo(typedOther.isSetPoCreatedAt());
643
    if (lastComparison != 0) {
644
      return lastComparison;
645
    }
646
    if (isSetPoCreatedAt()) {
647
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.poCreatedAt, typedOther.poCreatedAt);
648
      if (lastComparison != 0) {
649
        return lastComparison;
650
      }
651
    }
652
    lastComparison = Boolean.valueOf(isSetSupplierName()).compareTo(typedOther.isSetSupplierName());
653
    if (lastComparison != 0) {
654
      return lastComparison;
655
    }
656
    if (isSetSupplierName()) {
657
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supplierName, typedOther.supplierName);
658
      if (lastComparison != 0) {
659
        return lastComparison;
660
      }
661
    }
662
    lastComparison = Boolean.valueOf(isSetInvoiceNumbers()).compareTo(typedOther.isSetInvoiceNumbers());
663
    if (lastComparison != 0) {
664
      return lastComparison;
665
    }
666
    if (isSetInvoiceNumbers()) {
667
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invoiceNumbers, typedOther.invoiceNumbers);
668
      if (lastComparison != 0) {
669
        return lastComparison;
670
      }
671
    }
672
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
673
    if (lastComparison != 0) {
674
      return lastComparison;
675
    }
676
    if (isSetItemId()) {
677
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
678
      if (lastComparison != 0) {
679
        return lastComparison;
680
      }
681
    }
682
    lastComparison = Boolean.valueOf(isSetItemName()).compareTo(typedOther.isSetItemName());
683
    if (lastComparison != 0) {
684
      return lastComparison;
685
    }
686
    if (isSetItemName()) {
687
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemName, typedOther.itemName);
688
      if (lastComparison != 0) {
689
        return lastComparison;
690
      }
691
    }
692
    lastComparison = Boolean.valueOf(isSetUnitPrice()).compareTo(typedOther.isSetUnitPrice());
693
    if (lastComparison != 0) {
694
      return lastComparison;
695
    }
696
    if (isSetUnitPrice()) {
697
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unitPrice, typedOther.unitPrice);
698
      if (lastComparison != 0) {
699
        return lastComparison;
700
      }
701
    }
702
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
703
    if (lastComparison != 0) {
704
      return lastComparison;
705
    }
706
    if (isSetQuantity()) {
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
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: // PURCHASE_ORDER_ID
730
          if (field.type == org.apache.thrift.protocol.TType.I64) {
731
            this.purchaseOrderId = iprot.readI64();
732
            setPurchaseOrderIdIsSet(true);
733
          } else { 
734
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
735
          }
736
          break;
737
        case 2: // PO_CREATED_AT
738
          if (field.type == org.apache.thrift.protocol.TType.I64) {
739
            this.poCreatedAt = iprot.readI64();
740
            setPoCreatedAtIsSet(true);
741
          } else { 
742
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
743
          }
744
          break;
745
        case 3: // SUPPLIER_NAME
746
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
747
            this.supplierName = iprot.readString();
748
          } else { 
749
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
750
          }
751
          break;
752
        case 4: // INVOICE_NUMBERS
753
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
754
            this.invoiceNumbers = iprot.readString();
755
          } else { 
756
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
757
          }
758
          break;
759
        case 5: // ITEM_ID
760
          if (field.type == org.apache.thrift.protocol.TType.I64) {
761
            this.itemId = iprot.readI64();
762
            setItemIdIsSet(true);
763
          } else { 
764
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
765
          }
766
          break;
767
        case 6: // ITEM_NAME
768
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
769
            this.itemName = iprot.readString();
770
          } else { 
771
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
772
          }
773
          break;
774
        case 7: // UNIT_PRICE
775
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
776
            this.unitPrice = iprot.readDouble();
777
            setUnitPriceIsSet(true);
778
          } else { 
779
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
780
          }
781
          break;
782
        case 8: // QUANTITY
783
          if (field.type == org.apache.thrift.protocol.TType.I64) {
784
            this.quantity = iprot.readI64();
785
            setQuantityIsSet(true);
786
          } else { 
787
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
788
          }
789
          break;
790
        default:
791
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
792
      }
793
      iprot.readFieldEnd();
794
    }
795
    iprot.readStructEnd();
796
    validate();
797
  }
798
 
799
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
800
    validate();
801
 
802
    oprot.writeStructBegin(STRUCT_DESC);
803
    oprot.writeFieldBegin(PURCHASE_ORDER_ID_FIELD_DESC);
804
    oprot.writeI64(this.purchaseOrderId);
805
    oprot.writeFieldEnd();
806
    oprot.writeFieldBegin(PO_CREATED_AT_FIELD_DESC);
807
    oprot.writeI64(this.poCreatedAt);
808
    oprot.writeFieldEnd();
809
    if (this.supplierName != null) {
810
      oprot.writeFieldBegin(SUPPLIER_NAME_FIELD_DESC);
811
      oprot.writeString(this.supplierName);
812
      oprot.writeFieldEnd();
813
    }
814
    if (this.invoiceNumbers != null) {
815
      oprot.writeFieldBegin(INVOICE_NUMBERS_FIELD_DESC);
816
      oprot.writeString(this.invoiceNumbers);
817
      oprot.writeFieldEnd();
818
    }
819
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
820
    oprot.writeI64(this.itemId);
821
    oprot.writeFieldEnd();
822
    if (this.itemName != null) {
823
      oprot.writeFieldBegin(ITEM_NAME_FIELD_DESC);
824
      oprot.writeString(this.itemName);
825
      oprot.writeFieldEnd();
826
    }
827
    oprot.writeFieldBegin(UNIT_PRICE_FIELD_DESC);
828
    oprot.writeDouble(this.unitPrice);
829
    oprot.writeFieldEnd();
830
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
831
    oprot.writeI64(this.quantity);
832
    oprot.writeFieldEnd();
833
    oprot.writeFieldStop();
834
    oprot.writeStructEnd();
835
  }
836
 
837
  @Override
838
  public String toString() {
839
    StringBuilder sb = new StringBuilder("DetailedPurchaseScan(");
840
    boolean first = true;
841
 
842
    sb.append("purchaseOrderId:");
843
    sb.append(this.purchaseOrderId);
844
    first = false;
845
    if (!first) sb.append(", ");
846
    sb.append("poCreatedAt:");
847
    sb.append(this.poCreatedAt);
848
    first = false;
849
    if (!first) sb.append(", ");
850
    sb.append("supplierName:");
851
    if (this.supplierName == null) {
852
      sb.append("null");
853
    } else {
854
      sb.append(this.supplierName);
855
    }
856
    first = false;
857
    if (!first) sb.append(", ");
858
    sb.append("invoiceNumbers:");
859
    if (this.invoiceNumbers == null) {
860
      sb.append("null");
861
    } else {
862
      sb.append(this.invoiceNumbers);
863
    }
864
    first = false;
865
    if (!first) sb.append(", ");
866
    sb.append("itemId:");
867
    sb.append(this.itemId);
868
    first = false;
869
    if (!first) sb.append(", ");
870
    sb.append("itemName:");
871
    if (this.itemName == null) {
872
      sb.append("null");
873
    } else {
874
      sb.append(this.itemName);
875
    }
876
    first = false;
877
    if (!first) sb.append(", ");
878
    sb.append("unitPrice:");
879
    sb.append(this.unitPrice);
880
    first = false;
881
    if (!first) sb.append(", ");
882
    sb.append("quantity:");
883
    sb.append(this.quantity);
884
    first = false;
885
    sb.append(")");
886
    return sb.toString();
887
  }
888
 
889
  public void validate() throws org.apache.thrift.TException {
890
    // check for required fields
891
  }
892
 
893
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
894
    try {
895
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
896
    } catch (org.apache.thrift.TException te) {
897
      throw new java.io.IOException(te);
898
    }
899
  }
900
 
901
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
902
    try {
903
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
904
      __isset_bit_vector = new BitSet(1);
905
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
906
    } catch (org.apache.thrift.TException te) {
907
      throw new java.io.IOException(te);
908
    }
909
  }
910
 
911
}
912