Subversion Repositories SmartDukaan

Rev

Rev 5372 | Rev 6361 | Go to most recent revision | Details | Compare with Previous | 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);
5545 mandeep.dh 31
  private static final org.apache.thrift.protocol.TField BRAND_FIELD_DESC = new org.apache.thrift.protocol.TField("brand", org.apache.thrift.protocol.TType.STRING, (short)6);
32
  private static final org.apache.thrift.protocol.TField MODEL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("modelName", org.apache.thrift.protocol.TType.STRING, (short)7);
33
  private static final org.apache.thrift.protocol.TField MODEL_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("modelNumber", org.apache.thrift.protocol.TType.STRING, (short)8);
34
  private static final org.apache.thrift.protocol.TField COLOR_FIELD_DESC = new org.apache.thrift.protocol.TField("color", org.apache.thrift.protocol.TType.STRING, (short)9);
35
  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)10);
36
  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)11);
5372 mandeep.dh 37
 
38
  private long purchaseOrderId; // required
39
  private long poCreatedAt; // required
40
  private String supplierName; // required
41
  private String invoiceNumbers; // required
42
  private long itemId; // required
5545 mandeep.dh 43
  private String brand; // required
44
  private String modelName; // required
45
  private String modelNumber; // required
46
  private String color; // required
5372 mandeep.dh 47
  private double unitPrice; // required
48
  private long quantity; // required
49
 
50
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
51
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
52
    PURCHASE_ORDER_ID((short)1, "purchaseOrderId"),
53
    PO_CREATED_AT((short)2, "poCreatedAt"),
54
    SUPPLIER_NAME((short)3, "supplierName"),
55
    INVOICE_NUMBERS((short)4, "invoiceNumbers"),
56
    ITEM_ID((short)5, "itemId"),
5545 mandeep.dh 57
    BRAND((short)6, "brand"),
58
    MODEL_NAME((short)7, "modelName"),
59
    MODEL_NUMBER((short)8, "modelNumber"),
60
    COLOR((short)9, "color"),
61
    UNIT_PRICE((short)10, "unitPrice"),
62
    QUANTITY((short)11, "quantity");
5372 mandeep.dh 63
 
64
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
65
 
66
    static {
67
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
68
        byName.put(field.getFieldName(), field);
69
      }
70
    }
71
 
72
    /**
73
     * Find the _Fields constant that matches fieldId, or null if its not found.
74
     */
75
    public static _Fields findByThriftId(int fieldId) {
76
      switch(fieldId) {
77
        case 1: // PURCHASE_ORDER_ID
78
          return PURCHASE_ORDER_ID;
79
        case 2: // PO_CREATED_AT
80
          return PO_CREATED_AT;
81
        case 3: // SUPPLIER_NAME
82
          return SUPPLIER_NAME;
83
        case 4: // INVOICE_NUMBERS
84
          return INVOICE_NUMBERS;
85
        case 5: // ITEM_ID
86
          return ITEM_ID;
5545 mandeep.dh 87
        case 6: // BRAND
88
          return BRAND;
89
        case 7: // MODEL_NAME
90
          return MODEL_NAME;
91
        case 8: // MODEL_NUMBER
92
          return MODEL_NUMBER;
93
        case 9: // COLOR
94
          return COLOR;
95
        case 10: // UNIT_PRICE
5372 mandeep.dh 96
          return UNIT_PRICE;
5545 mandeep.dh 97
        case 11: // QUANTITY
5372 mandeep.dh 98
          return QUANTITY;
99
        default:
100
          return null;
101
      }
102
    }
103
 
104
    /**
105
     * Find the _Fields constant that matches fieldId, throwing an exception
106
     * if it is not found.
107
     */
108
    public static _Fields findByThriftIdOrThrow(int fieldId) {
109
      _Fields fields = findByThriftId(fieldId);
110
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
111
      return fields;
112
    }
113
 
114
    /**
115
     * Find the _Fields constant that matches name, or null if its not found.
116
     */
117
    public static _Fields findByName(String name) {
118
      return byName.get(name);
119
    }
120
 
121
    private final short _thriftId;
122
    private final String _fieldName;
123
 
124
    _Fields(short thriftId, String fieldName) {
125
      _thriftId = thriftId;
126
      _fieldName = fieldName;
127
    }
128
 
129
    public short getThriftFieldId() {
130
      return _thriftId;
131
    }
132
 
133
    public String getFieldName() {
134
      return _fieldName;
135
    }
136
  }
137
 
138
  // isset id assignments
139
  private static final int __PURCHASEORDERID_ISSET_ID = 0;
140
  private static final int __POCREATEDAT_ISSET_ID = 1;
141
  private static final int __ITEMID_ISSET_ID = 2;
142
  private static final int __UNITPRICE_ISSET_ID = 3;
143
  private static final int __QUANTITY_ISSET_ID = 4;
144
  private BitSet __isset_bit_vector = new BitSet(5);
145
 
146
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
147
  static {
148
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
149
    tmpMap.put(_Fields.PURCHASE_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("purchaseOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
151
    tmpMap.put(_Fields.PO_CREATED_AT, new org.apache.thrift.meta_data.FieldMetaData("poCreatedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
153
    tmpMap.put(_Fields.SUPPLIER_NAME, new org.apache.thrift.meta_data.FieldMetaData("supplierName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
155
    tmpMap.put(_Fields.INVOICE_NUMBERS, new org.apache.thrift.meta_data.FieldMetaData("invoiceNumbers", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
157
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5545 mandeep.dh 159
    tmpMap.put(_Fields.BRAND, new org.apache.thrift.meta_data.FieldMetaData("brand", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5372 mandeep.dh 160
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5545 mandeep.dh 161
    tmpMap.put(_Fields.MODEL_NAME, new org.apache.thrift.meta_data.FieldMetaData("modelName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
162
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
163
    tmpMap.put(_Fields.MODEL_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("modelNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
164
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
165
    tmpMap.put(_Fields.COLOR, new org.apache.thrift.meta_data.FieldMetaData("color", org.apache.thrift.TFieldRequirementType.DEFAULT, 
166
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5372 mandeep.dh 167
    tmpMap.put(_Fields.UNIT_PRICE, new org.apache.thrift.meta_data.FieldMetaData("unitPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
168
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
169
    tmpMap.put(_Fields.QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("quantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
170
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
171
    metaDataMap = Collections.unmodifiableMap(tmpMap);
172
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DetailedPurchaseScan.class, metaDataMap);
173
  }
174
 
175
  public DetailedPurchaseScan() {
176
  }
177
 
178
  public DetailedPurchaseScan(
179
    long purchaseOrderId,
180
    long poCreatedAt,
181
    String supplierName,
182
    String invoiceNumbers,
183
    long itemId,
5545 mandeep.dh 184
    String brand,
185
    String modelName,
186
    String modelNumber,
187
    String color,
5372 mandeep.dh 188
    double unitPrice,
189
    long quantity)
190
  {
191
    this();
192
    this.purchaseOrderId = purchaseOrderId;
193
    setPurchaseOrderIdIsSet(true);
194
    this.poCreatedAt = poCreatedAt;
195
    setPoCreatedAtIsSet(true);
196
    this.supplierName = supplierName;
197
    this.invoiceNumbers = invoiceNumbers;
198
    this.itemId = itemId;
199
    setItemIdIsSet(true);
5545 mandeep.dh 200
    this.brand = brand;
201
    this.modelName = modelName;
202
    this.modelNumber = modelNumber;
203
    this.color = color;
5372 mandeep.dh 204
    this.unitPrice = unitPrice;
205
    setUnitPriceIsSet(true);
206
    this.quantity = quantity;
207
    setQuantityIsSet(true);
208
  }
209
 
210
  /**
211
   * Performs a deep copy on <i>other</i>.
212
   */
213
  public DetailedPurchaseScan(DetailedPurchaseScan other) {
214
    __isset_bit_vector.clear();
215
    __isset_bit_vector.or(other.__isset_bit_vector);
216
    this.purchaseOrderId = other.purchaseOrderId;
217
    this.poCreatedAt = other.poCreatedAt;
218
    if (other.isSetSupplierName()) {
219
      this.supplierName = other.supplierName;
220
    }
221
    if (other.isSetInvoiceNumbers()) {
222
      this.invoiceNumbers = other.invoiceNumbers;
223
    }
224
    this.itemId = other.itemId;
5545 mandeep.dh 225
    if (other.isSetBrand()) {
226
      this.brand = other.brand;
5372 mandeep.dh 227
    }
5545 mandeep.dh 228
    if (other.isSetModelName()) {
229
      this.modelName = other.modelName;
230
    }
231
    if (other.isSetModelNumber()) {
232
      this.modelNumber = other.modelNumber;
233
    }
234
    if (other.isSetColor()) {
235
      this.color = other.color;
236
    }
5372 mandeep.dh 237
    this.unitPrice = other.unitPrice;
238
    this.quantity = other.quantity;
239
  }
240
 
241
  public DetailedPurchaseScan deepCopy() {
242
    return new DetailedPurchaseScan(this);
243
  }
244
 
245
  @Override
246
  public void clear() {
247
    setPurchaseOrderIdIsSet(false);
248
    this.purchaseOrderId = 0;
249
    setPoCreatedAtIsSet(false);
250
    this.poCreatedAt = 0;
251
    this.supplierName = null;
252
    this.invoiceNumbers = null;
253
    setItemIdIsSet(false);
254
    this.itemId = 0;
5545 mandeep.dh 255
    this.brand = null;
256
    this.modelName = null;
257
    this.modelNumber = null;
258
    this.color = null;
5372 mandeep.dh 259
    setUnitPriceIsSet(false);
260
    this.unitPrice = 0.0;
261
    setQuantityIsSet(false);
262
    this.quantity = 0;
263
  }
264
 
265
  public long getPurchaseOrderId() {
266
    return this.purchaseOrderId;
267
  }
268
 
269
  public void setPurchaseOrderId(long purchaseOrderId) {
270
    this.purchaseOrderId = purchaseOrderId;
271
    setPurchaseOrderIdIsSet(true);
272
  }
273
 
274
  public void unsetPurchaseOrderId() {
275
    __isset_bit_vector.clear(__PURCHASEORDERID_ISSET_ID);
276
  }
277
 
278
  /** Returns true if field purchaseOrderId is set (has been assigned a value) and false otherwise */
279
  public boolean isSetPurchaseOrderId() {
280
    return __isset_bit_vector.get(__PURCHASEORDERID_ISSET_ID);
281
  }
282
 
283
  public void setPurchaseOrderIdIsSet(boolean value) {
284
    __isset_bit_vector.set(__PURCHASEORDERID_ISSET_ID, value);
285
  }
286
 
287
  public long getPoCreatedAt() {
288
    return this.poCreatedAt;
289
  }
290
 
291
  public void setPoCreatedAt(long poCreatedAt) {
292
    this.poCreatedAt = poCreatedAt;
293
    setPoCreatedAtIsSet(true);
294
  }
295
 
296
  public void unsetPoCreatedAt() {
297
    __isset_bit_vector.clear(__POCREATEDAT_ISSET_ID);
298
  }
299
 
300
  /** Returns true if field poCreatedAt is set (has been assigned a value) and false otherwise */
301
  public boolean isSetPoCreatedAt() {
302
    return __isset_bit_vector.get(__POCREATEDAT_ISSET_ID);
303
  }
304
 
305
  public void setPoCreatedAtIsSet(boolean value) {
306
    __isset_bit_vector.set(__POCREATEDAT_ISSET_ID, value);
307
  }
308
 
309
  public String getSupplierName() {
310
    return this.supplierName;
311
  }
312
 
313
  public void setSupplierName(String supplierName) {
314
    this.supplierName = supplierName;
315
  }
316
 
317
  public void unsetSupplierName() {
318
    this.supplierName = null;
319
  }
320
 
321
  /** Returns true if field supplierName is set (has been assigned a value) and false otherwise */
322
  public boolean isSetSupplierName() {
323
    return this.supplierName != null;
324
  }
325
 
326
  public void setSupplierNameIsSet(boolean value) {
327
    if (!value) {
328
      this.supplierName = null;
329
    }
330
  }
331
 
332
  public String getInvoiceNumbers() {
333
    return this.invoiceNumbers;
334
  }
335
 
336
  public void setInvoiceNumbers(String invoiceNumbers) {
337
    this.invoiceNumbers = invoiceNumbers;
338
  }
339
 
340
  public void unsetInvoiceNumbers() {
341
    this.invoiceNumbers = null;
342
  }
343
 
344
  /** Returns true if field invoiceNumbers is set (has been assigned a value) and false otherwise */
345
  public boolean isSetInvoiceNumbers() {
346
    return this.invoiceNumbers != null;
347
  }
348
 
349
  public void setInvoiceNumbersIsSet(boolean value) {
350
    if (!value) {
351
      this.invoiceNumbers = null;
352
    }
353
  }
354
 
355
  public long getItemId() {
356
    return this.itemId;
357
  }
358
 
359
  public void setItemId(long itemId) {
360
    this.itemId = itemId;
361
    setItemIdIsSet(true);
362
  }
363
 
364
  public void unsetItemId() {
365
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
366
  }
367
 
368
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
369
  public boolean isSetItemId() {
370
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
371
  }
372
 
373
  public void setItemIdIsSet(boolean value) {
374
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
375
  }
376
 
5545 mandeep.dh 377
  public String getBrand() {
378
    return this.brand;
5372 mandeep.dh 379
  }
380
 
5545 mandeep.dh 381
  public void setBrand(String brand) {
382
    this.brand = brand;
5372 mandeep.dh 383
  }
384
 
5545 mandeep.dh 385
  public void unsetBrand() {
386
    this.brand = null;
5372 mandeep.dh 387
  }
388
 
5545 mandeep.dh 389
  /** Returns true if field brand is set (has been assigned a value) and false otherwise */
390
  public boolean isSetBrand() {
391
    return this.brand != null;
5372 mandeep.dh 392
  }
393
 
5545 mandeep.dh 394
  public void setBrandIsSet(boolean value) {
5372 mandeep.dh 395
    if (!value) {
5545 mandeep.dh 396
      this.brand = null;
5372 mandeep.dh 397
    }
398
  }
399
 
5545 mandeep.dh 400
  public String getModelName() {
401
    return this.modelName;
402
  }
403
 
404
  public void setModelName(String modelName) {
405
    this.modelName = modelName;
406
  }
407
 
408
  public void unsetModelName() {
409
    this.modelName = null;
410
  }
411
 
412
  /** Returns true if field modelName is set (has been assigned a value) and false otherwise */
413
  public boolean isSetModelName() {
414
    return this.modelName != null;
415
  }
416
 
417
  public void setModelNameIsSet(boolean value) {
418
    if (!value) {
419
      this.modelName = null;
420
    }
421
  }
422
 
423
  public String getModelNumber() {
424
    return this.modelNumber;
425
  }
426
 
427
  public void setModelNumber(String modelNumber) {
428
    this.modelNumber = modelNumber;
429
  }
430
 
431
  public void unsetModelNumber() {
432
    this.modelNumber = null;
433
  }
434
 
435
  /** Returns true if field modelNumber is set (has been assigned a value) and false otherwise */
436
  public boolean isSetModelNumber() {
437
    return this.modelNumber != null;
438
  }
439
 
440
  public void setModelNumberIsSet(boolean value) {
441
    if (!value) {
442
      this.modelNumber = null;
443
    }
444
  }
445
 
446
  public String getColor() {
447
    return this.color;
448
  }
449
 
450
  public void setColor(String color) {
451
    this.color = color;
452
  }
453
 
454
  public void unsetColor() {
455
    this.color = null;
456
  }
457
 
458
  /** Returns true if field color is set (has been assigned a value) and false otherwise */
459
  public boolean isSetColor() {
460
    return this.color != null;
461
  }
462
 
463
  public void setColorIsSet(boolean value) {
464
    if (!value) {
465
      this.color = null;
466
    }
467
  }
468
 
5372 mandeep.dh 469
  public double getUnitPrice() {
470
    return this.unitPrice;
471
  }
472
 
473
  public void setUnitPrice(double unitPrice) {
474
    this.unitPrice = unitPrice;
475
    setUnitPriceIsSet(true);
476
  }
477
 
478
  public void unsetUnitPrice() {
479
    __isset_bit_vector.clear(__UNITPRICE_ISSET_ID);
480
  }
481
 
482
  /** Returns true if field unitPrice is set (has been assigned a value) and false otherwise */
483
  public boolean isSetUnitPrice() {
484
    return __isset_bit_vector.get(__UNITPRICE_ISSET_ID);
485
  }
486
 
487
  public void setUnitPriceIsSet(boolean value) {
488
    __isset_bit_vector.set(__UNITPRICE_ISSET_ID, value);
489
  }
490
 
491
  public long getQuantity() {
492
    return this.quantity;
493
  }
494
 
495
  public void setQuantity(long quantity) {
496
    this.quantity = quantity;
497
    setQuantityIsSet(true);
498
  }
499
 
500
  public void unsetQuantity() {
501
    __isset_bit_vector.clear(__QUANTITY_ISSET_ID);
502
  }
503
 
504
  /** Returns true if field quantity is set (has been assigned a value) and false otherwise */
505
  public boolean isSetQuantity() {
506
    return __isset_bit_vector.get(__QUANTITY_ISSET_ID);
507
  }
508
 
509
  public void setQuantityIsSet(boolean value) {
510
    __isset_bit_vector.set(__QUANTITY_ISSET_ID, value);
511
  }
512
 
513
  public void setFieldValue(_Fields field, Object value) {
514
    switch (field) {
515
    case PURCHASE_ORDER_ID:
516
      if (value == null) {
517
        unsetPurchaseOrderId();
518
      } else {
519
        setPurchaseOrderId((Long)value);
520
      }
521
      break;
522
 
523
    case PO_CREATED_AT:
524
      if (value == null) {
525
        unsetPoCreatedAt();
526
      } else {
527
        setPoCreatedAt((Long)value);
528
      }
529
      break;
530
 
531
    case SUPPLIER_NAME:
532
      if (value == null) {
533
        unsetSupplierName();
534
      } else {
535
        setSupplierName((String)value);
536
      }
537
      break;
538
 
539
    case INVOICE_NUMBERS:
540
      if (value == null) {
541
        unsetInvoiceNumbers();
542
      } else {
543
        setInvoiceNumbers((String)value);
544
      }
545
      break;
546
 
547
    case ITEM_ID:
548
      if (value == null) {
549
        unsetItemId();
550
      } else {
551
        setItemId((Long)value);
552
      }
553
      break;
554
 
5545 mandeep.dh 555
    case BRAND:
5372 mandeep.dh 556
      if (value == null) {
5545 mandeep.dh 557
        unsetBrand();
5372 mandeep.dh 558
      } else {
5545 mandeep.dh 559
        setBrand((String)value);
5372 mandeep.dh 560
      }
561
      break;
562
 
5545 mandeep.dh 563
    case MODEL_NAME:
564
      if (value == null) {
565
        unsetModelName();
566
      } else {
567
        setModelName((String)value);
568
      }
569
      break;
570
 
571
    case MODEL_NUMBER:
572
      if (value == null) {
573
        unsetModelNumber();
574
      } else {
575
        setModelNumber((String)value);
576
      }
577
      break;
578
 
579
    case COLOR:
580
      if (value == null) {
581
        unsetColor();
582
      } else {
583
        setColor((String)value);
584
      }
585
      break;
586
 
5372 mandeep.dh 587
    case UNIT_PRICE:
588
      if (value == null) {
589
        unsetUnitPrice();
590
      } else {
591
        setUnitPrice((Double)value);
592
      }
593
      break;
594
 
595
    case QUANTITY:
596
      if (value == null) {
597
        unsetQuantity();
598
      } else {
599
        setQuantity((Long)value);
600
      }
601
      break;
602
 
603
    }
604
  }
605
 
606
  public Object getFieldValue(_Fields field) {
607
    switch (field) {
608
    case PURCHASE_ORDER_ID:
609
      return Long.valueOf(getPurchaseOrderId());
610
 
611
    case PO_CREATED_AT:
612
      return Long.valueOf(getPoCreatedAt());
613
 
614
    case SUPPLIER_NAME:
615
      return getSupplierName();
616
 
617
    case INVOICE_NUMBERS:
618
      return getInvoiceNumbers();
619
 
620
    case ITEM_ID:
621
      return Long.valueOf(getItemId());
622
 
5545 mandeep.dh 623
    case BRAND:
624
      return getBrand();
5372 mandeep.dh 625
 
5545 mandeep.dh 626
    case MODEL_NAME:
627
      return getModelName();
628
 
629
    case MODEL_NUMBER:
630
      return getModelNumber();
631
 
632
    case COLOR:
633
      return getColor();
634
 
5372 mandeep.dh 635
    case UNIT_PRICE:
636
      return Double.valueOf(getUnitPrice());
637
 
638
    case QUANTITY:
639
      return Long.valueOf(getQuantity());
640
 
641
    }
642
    throw new IllegalStateException();
643
  }
644
 
645
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
646
  public boolean isSet(_Fields field) {
647
    if (field == null) {
648
      throw new IllegalArgumentException();
649
    }
650
 
651
    switch (field) {
652
    case PURCHASE_ORDER_ID:
653
      return isSetPurchaseOrderId();
654
    case PO_CREATED_AT:
655
      return isSetPoCreatedAt();
656
    case SUPPLIER_NAME:
657
      return isSetSupplierName();
658
    case INVOICE_NUMBERS:
659
      return isSetInvoiceNumbers();
660
    case ITEM_ID:
661
      return isSetItemId();
5545 mandeep.dh 662
    case BRAND:
663
      return isSetBrand();
664
    case MODEL_NAME:
665
      return isSetModelName();
666
    case MODEL_NUMBER:
667
      return isSetModelNumber();
668
    case COLOR:
669
      return isSetColor();
5372 mandeep.dh 670
    case UNIT_PRICE:
671
      return isSetUnitPrice();
672
    case QUANTITY:
673
      return isSetQuantity();
674
    }
675
    throw new IllegalStateException();
676
  }
677
 
678
  @Override
679
  public boolean equals(Object that) {
680
    if (that == null)
681
      return false;
682
    if (that instanceof DetailedPurchaseScan)
683
      return this.equals((DetailedPurchaseScan)that);
684
    return false;
685
  }
686
 
687
  public boolean equals(DetailedPurchaseScan that) {
688
    if (that == null)
689
      return false;
690
 
691
    boolean this_present_purchaseOrderId = true;
692
    boolean that_present_purchaseOrderId = true;
693
    if (this_present_purchaseOrderId || that_present_purchaseOrderId) {
694
      if (!(this_present_purchaseOrderId && that_present_purchaseOrderId))
695
        return false;
696
      if (this.purchaseOrderId != that.purchaseOrderId)
697
        return false;
698
    }
699
 
700
    boolean this_present_poCreatedAt = true;
701
    boolean that_present_poCreatedAt = true;
702
    if (this_present_poCreatedAt || that_present_poCreatedAt) {
703
      if (!(this_present_poCreatedAt && that_present_poCreatedAt))
704
        return false;
705
      if (this.poCreatedAt != that.poCreatedAt)
706
        return false;
707
    }
708
 
709
    boolean this_present_supplierName = true && this.isSetSupplierName();
710
    boolean that_present_supplierName = true && that.isSetSupplierName();
711
    if (this_present_supplierName || that_present_supplierName) {
712
      if (!(this_present_supplierName && that_present_supplierName))
713
        return false;
714
      if (!this.supplierName.equals(that.supplierName))
715
        return false;
716
    }
717
 
718
    boolean this_present_invoiceNumbers = true && this.isSetInvoiceNumbers();
719
    boolean that_present_invoiceNumbers = true && that.isSetInvoiceNumbers();
720
    if (this_present_invoiceNumbers || that_present_invoiceNumbers) {
721
      if (!(this_present_invoiceNumbers && that_present_invoiceNumbers))
722
        return false;
723
      if (!this.invoiceNumbers.equals(that.invoiceNumbers))
724
        return false;
725
    }
726
 
727
    boolean this_present_itemId = true;
728
    boolean that_present_itemId = true;
729
    if (this_present_itemId || that_present_itemId) {
730
      if (!(this_present_itemId && that_present_itemId))
731
        return false;
732
      if (this.itemId != that.itemId)
733
        return false;
734
    }
735
 
5545 mandeep.dh 736
    boolean this_present_brand = true && this.isSetBrand();
737
    boolean that_present_brand = true && that.isSetBrand();
738
    if (this_present_brand || that_present_brand) {
739
      if (!(this_present_brand && that_present_brand))
5372 mandeep.dh 740
        return false;
5545 mandeep.dh 741
      if (!this.brand.equals(that.brand))
5372 mandeep.dh 742
        return false;
743
    }
744
 
5545 mandeep.dh 745
    boolean this_present_modelName = true && this.isSetModelName();
746
    boolean that_present_modelName = true && that.isSetModelName();
747
    if (this_present_modelName || that_present_modelName) {
748
      if (!(this_present_modelName && that_present_modelName))
749
        return false;
750
      if (!this.modelName.equals(that.modelName))
751
        return false;
752
    }
753
 
754
    boolean this_present_modelNumber = true && this.isSetModelNumber();
755
    boolean that_present_modelNumber = true && that.isSetModelNumber();
756
    if (this_present_modelNumber || that_present_modelNumber) {
757
      if (!(this_present_modelNumber && that_present_modelNumber))
758
        return false;
759
      if (!this.modelNumber.equals(that.modelNumber))
760
        return false;
761
    }
762
 
763
    boolean this_present_color = true && this.isSetColor();
764
    boolean that_present_color = true && that.isSetColor();
765
    if (this_present_color || that_present_color) {
766
      if (!(this_present_color && that_present_color))
767
        return false;
768
      if (!this.color.equals(that.color))
769
        return false;
770
    }
771
 
5372 mandeep.dh 772
    boolean this_present_unitPrice = true;
773
    boolean that_present_unitPrice = true;
774
    if (this_present_unitPrice || that_present_unitPrice) {
775
      if (!(this_present_unitPrice && that_present_unitPrice))
776
        return false;
777
      if (this.unitPrice != that.unitPrice)
778
        return false;
779
    }
780
 
781
    boolean this_present_quantity = true;
782
    boolean that_present_quantity = true;
783
    if (this_present_quantity || that_present_quantity) {
784
      if (!(this_present_quantity && that_present_quantity))
785
        return false;
786
      if (this.quantity != that.quantity)
787
        return false;
788
    }
789
 
790
    return true;
791
  }
792
 
793
  @Override
794
  public int hashCode() {
795
    return 0;
796
  }
797
 
798
  public int compareTo(DetailedPurchaseScan other) {
799
    if (!getClass().equals(other.getClass())) {
800
      return getClass().getName().compareTo(other.getClass().getName());
801
    }
802
 
803
    int lastComparison = 0;
804
    DetailedPurchaseScan typedOther = (DetailedPurchaseScan)other;
805
 
806
    lastComparison = Boolean.valueOf(isSetPurchaseOrderId()).compareTo(typedOther.isSetPurchaseOrderId());
807
    if (lastComparison != 0) {
808
      return lastComparison;
809
    }
810
    if (isSetPurchaseOrderId()) {
811
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purchaseOrderId, typedOther.purchaseOrderId);
812
      if (lastComparison != 0) {
813
        return lastComparison;
814
      }
815
    }
816
    lastComparison = Boolean.valueOf(isSetPoCreatedAt()).compareTo(typedOther.isSetPoCreatedAt());
817
    if (lastComparison != 0) {
818
      return lastComparison;
819
    }
820
    if (isSetPoCreatedAt()) {
821
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.poCreatedAt, typedOther.poCreatedAt);
822
      if (lastComparison != 0) {
823
        return lastComparison;
824
      }
825
    }
826
    lastComparison = Boolean.valueOf(isSetSupplierName()).compareTo(typedOther.isSetSupplierName());
827
    if (lastComparison != 0) {
828
      return lastComparison;
829
    }
830
    if (isSetSupplierName()) {
831
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supplierName, typedOther.supplierName);
832
      if (lastComparison != 0) {
833
        return lastComparison;
834
      }
835
    }
836
    lastComparison = Boolean.valueOf(isSetInvoiceNumbers()).compareTo(typedOther.isSetInvoiceNumbers());
837
    if (lastComparison != 0) {
838
      return lastComparison;
839
    }
840
    if (isSetInvoiceNumbers()) {
841
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invoiceNumbers, typedOther.invoiceNumbers);
842
      if (lastComparison != 0) {
843
        return lastComparison;
844
      }
845
    }
846
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
847
    if (lastComparison != 0) {
848
      return lastComparison;
849
    }
850
    if (isSetItemId()) {
851
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
852
      if (lastComparison != 0) {
853
        return lastComparison;
854
      }
855
    }
5545 mandeep.dh 856
    lastComparison = Boolean.valueOf(isSetBrand()).compareTo(typedOther.isSetBrand());
5372 mandeep.dh 857
    if (lastComparison != 0) {
858
      return lastComparison;
859
    }
5545 mandeep.dh 860
    if (isSetBrand()) {
861
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.brand, typedOther.brand);
5372 mandeep.dh 862
      if (lastComparison != 0) {
863
        return lastComparison;
864
      }
865
    }
5545 mandeep.dh 866
    lastComparison = Boolean.valueOf(isSetModelName()).compareTo(typedOther.isSetModelName());
867
    if (lastComparison != 0) {
868
      return lastComparison;
869
    }
870
    if (isSetModelName()) {
871
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelName, typedOther.modelName);
872
      if (lastComparison != 0) {
873
        return lastComparison;
874
      }
875
    }
876
    lastComparison = Boolean.valueOf(isSetModelNumber()).compareTo(typedOther.isSetModelNumber());
877
    if (lastComparison != 0) {
878
      return lastComparison;
879
    }
880
    if (isSetModelNumber()) {
881
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modelNumber, typedOther.modelNumber);
882
      if (lastComparison != 0) {
883
        return lastComparison;
884
      }
885
    }
886
    lastComparison = Boolean.valueOf(isSetColor()).compareTo(typedOther.isSetColor());
887
    if (lastComparison != 0) {
888
      return lastComparison;
889
    }
890
    if (isSetColor()) {
891
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.color, typedOther.color);
892
      if (lastComparison != 0) {
893
        return lastComparison;
894
      }
895
    }
5372 mandeep.dh 896
    lastComparison = Boolean.valueOf(isSetUnitPrice()).compareTo(typedOther.isSetUnitPrice());
897
    if (lastComparison != 0) {
898
      return lastComparison;
899
    }
900
    if (isSetUnitPrice()) {
901
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.unitPrice, typedOther.unitPrice);
902
      if (lastComparison != 0) {
903
        return lastComparison;
904
      }
905
    }
906
    lastComparison = Boolean.valueOf(isSetQuantity()).compareTo(typedOther.isSetQuantity());
907
    if (lastComparison != 0) {
908
      return lastComparison;
909
    }
910
    if (isSetQuantity()) {
911
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.quantity, typedOther.quantity);
912
      if (lastComparison != 0) {
913
        return lastComparison;
914
      }
915
    }
916
    return 0;
917
  }
918
 
919
  public _Fields fieldForId(int fieldId) {
920
    return _Fields.findByThriftId(fieldId);
921
  }
922
 
923
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
924
    org.apache.thrift.protocol.TField field;
925
    iprot.readStructBegin();
926
    while (true)
927
    {
928
      field = iprot.readFieldBegin();
929
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
930
        break;
931
      }
932
      switch (field.id) {
933
        case 1: // PURCHASE_ORDER_ID
934
          if (field.type == org.apache.thrift.protocol.TType.I64) {
935
            this.purchaseOrderId = iprot.readI64();
936
            setPurchaseOrderIdIsSet(true);
937
          } else { 
938
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
939
          }
940
          break;
941
        case 2: // PO_CREATED_AT
942
          if (field.type == org.apache.thrift.protocol.TType.I64) {
943
            this.poCreatedAt = iprot.readI64();
944
            setPoCreatedAtIsSet(true);
945
          } else { 
946
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
947
          }
948
          break;
949
        case 3: // SUPPLIER_NAME
950
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
951
            this.supplierName = iprot.readString();
952
          } else { 
953
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
954
          }
955
          break;
956
        case 4: // INVOICE_NUMBERS
957
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
958
            this.invoiceNumbers = iprot.readString();
959
          } else { 
960
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
961
          }
962
          break;
963
        case 5: // ITEM_ID
964
          if (field.type == org.apache.thrift.protocol.TType.I64) {
965
            this.itemId = iprot.readI64();
966
            setItemIdIsSet(true);
967
          } else { 
968
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
969
          }
970
          break;
5545 mandeep.dh 971
        case 6: // BRAND
5372 mandeep.dh 972
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
5545 mandeep.dh 973
            this.brand = iprot.readString();
5372 mandeep.dh 974
          } else { 
975
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
976
          }
977
          break;
5545 mandeep.dh 978
        case 7: // MODEL_NAME
979
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
980
            this.modelName = iprot.readString();
981
          } else { 
982
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
983
          }
984
          break;
985
        case 8: // MODEL_NUMBER
986
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
987
            this.modelNumber = iprot.readString();
988
          } else { 
989
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
990
          }
991
          break;
992
        case 9: // COLOR
993
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
994
            this.color = iprot.readString();
995
          } else { 
996
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
997
          }
998
          break;
999
        case 10: // UNIT_PRICE
5372 mandeep.dh 1000
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
1001
            this.unitPrice = iprot.readDouble();
1002
            setUnitPriceIsSet(true);
1003
          } else { 
1004
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1005
          }
1006
          break;
5545 mandeep.dh 1007
        case 11: // QUANTITY
5372 mandeep.dh 1008
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1009
            this.quantity = iprot.readI64();
1010
            setQuantityIsSet(true);
1011
          } else { 
1012
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1013
          }
1014
          break;
1015
        default:
1016
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1017
      }
1018
      iprot.readFieldEnd();
1019
    }
1020
    iprot.readStructEnd();
1021
    validate();
1022
  }
1023
 
1024
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1025
    validate();
1026
 
1027
    oprot.writeStructBegin(STRUCT_DESC);
1028
    oprot.writeFieldBegin(PURCHASE_ORDER_ID_FIELD_DESC);
1029
    oprot.writeI64(this.purchaseOrderId);
1030
    oprot.writeFieldEnd();
1031
    oprot.writeFieldBegin(PO_CREATED_AT_FIELD_DESC);
1032
    oprot.writeI64(this.poCreatedAt);
1033
    oprot.writeFieldEnd();
1034
    if (this.supplierName != null) {
1035
      oprot.writeFieldBegin(SUPPLIER_NAME_FIELD_DESC);
1036
      oprot.writeString(this.supplierName);
1037
      oprot.writeFieldEnd();
1038
    }
1039
    if (this.invoiceNumbers != null) {
1040
      oprot.writeFieldBegin(INVOICE_NUMBERS_FIELD_DESC);
1041
      oprot.writeString(this.invoiceNumbers);
1042
      oprot.writeFieldEnd();
1043
    }
1044
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
1045
    oprot.writeI64(this.itemId);
1046
    oprot.writeFieldEnd();
5545 mandeep.dh 1047
    if (this.brand != null) {
1048
      oprot.writeFieldBegin(BRAND_FIELD_DESC);
1049
      oprot.writeString(this.brand);
5372 mandeep.dh 1050
      oprot.writeFieldEnd();
1051
    }
5545 mandeep.dh 1052
    if (this.modelName != null) {
1053
      oprot.writeFieldBegin(MODEL_NAME_FIELD_DESC);
1054
      oprot.writeString(this.modelName);
1055
      oprot.writeFieldEnd();
1056
    }
1057
    if (this.modelNumber != null) {
1058
      oprot.writeFieldBegin(MODEL_NUMBER_FIELD_DESC);
1059
      oprot.writeString(this.modelNumber);
1060
      oprot.writeFieldEnd();
1061
    }
1062
    if (this.color != null) {
1063
      oprot.writeFieldBegin(COLOR_FIELD_DESC);
1064
      oprot.writeString(this.color);
1065
      oprot.writeFieldEnd();
1066
    }
5372 mandeep.dh 1067
    oprot.writeFieldBegin(UNIT_PRICE_FIELD_DESC);
1068
    oprot.writeDouble(this.unitPrice);
1069
    oprot.writeFieldEnd();
1070
    oprot.writeFieldBegin(QUANTITY_FIELD_DESC);
1071
    oprot.writeI64(this.quantity);
1072
    oprot.writeFieldEnd();
1073
    oprot.writeFieldStop();
1074
    oprot.writeStructEnd();
1075
  }
1076
 
1077
  @Override
1078
  public String toString() {
1079
    StringBuilder sb = new StringBuilder("DetailedPurchaseScan(");
1080
    boolean first = true;
1081
 
1082
    sb.append("purchaseOrderId:");
1083
    sb.append(this.purchaseOrderId);
1084
    first = false;
1085
    if (!first) sb.append(", ");
1086
    sb.append("poCreatedAt:");
1087
    sb.append(this.poCreatedAt);
1088
    first = false;
1089
    if (!first) sb.append(", ");
1090
    sb.append("supplierName:");
1091
    if (this.supplierName == null) {
1092
      sb.append("null");
1093
    } else {
1094
      sb.append(this.supplierName);
1095
    }
1096
    first = false;
1097
    if (!first) sb.append(", ");
1098
    sb.append("invoiceNumbers:");
1099
    if (this.invoiceNumbers == null) {
1100
      sb.append("null");
1101
    } else {
1102
      sb.append(this.invoiceNumbers);
1103
    }
1104
    first = false;
1105
    if (!first) sb.append(", ");
1106
    sb.append("itemId:");
1107
    sb.append(this.itemId);
1108
    first = false;
1109
    if (!first) sb.append(", ");
5545 mandeep.dh 1110
    sb.append("brand:");
1111
    if (this.brand == null) {
5372 mandeep.dh 1112
      sb.append("null");
1113
    } else {
5545 mandeep.dh 1114
      sb.append(this.brand);
5372 mandeep.dh 1115
    }
1116
    first = false;
1117
    if (!first) sb.append(", ");
5545 mandeep.dh 1118
    sb.append("modelName:");
1119
    if (this.modelName == null) {
1120
      sb.append("null");
1121
    } else {
1122
      sb.append(this.modelName);
1123
    }
1124
    first = false;
1125
    if (!first) sb.append(", ");
1126
    sb.append("modelNumber:");
1127
    if (this.modelNumber == null) {
1128
      sb.append("null");
1129
    } else {
1130
      sb.append(this.modelNumber);
1131
    }
1132
    first = false;
1133
    if (!first) sb.append(", ");
1134
    sb.append("color:");
1135
    if (this.color == null) {
1136
      sb.append("null");
1137
    } else {
1138
      sb.append(this.color);
1139
    }
1140
    first = false;
1141
    if (!first) sb.append(", ");
5372 mandeep.dh 1142
    sb.append("unitPrice:");
1143
    sb.append(this.unitPrice);
1144
    first = false;
1145
    if (!first) sb.append(", ");
1146
    sb.append("quantity:");
1147
    sb.append(this.quantity);
1148
    first = false;
1149
    sb.append(")");
1150
    return sb.toString();
1151
  }
1152
 
1153
  public void validate() throws org.apache.thrift.TException {
1154
    // check for required fields
1155
  }
1156
 
1157
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1158
    try {
1159
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1160
    } catch (org.apache.thrift.TException te) {
1161
      throw new java.io.IOException(te);
1162
    }
1163
  }
1164
 
1165
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1166
    try {
1167
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1168
      __isset_bit_vector = new BitSet(1);
1169
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1170
    } catch (org.apache.thrift.TException te) {
1171
      throw new java.io.IOException(te);
1172
    }
1173
  }
1174
 
1175
}
1176