Subversion Repositories SmartDukaan

Rev

Rev 6821 | Rev 9925 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4496 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.purchase;
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 PurchaseOrder implements org.apache.thrift.TBase<PurchaseOrder, PurchaseOrder._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PurchaseOrder");
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 PO_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("poNumber", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField LINEITEMS_FIELD_DESC = new org.apache.thrift.protocol.TField("lineitems", org.apache.thrift.protocol.TType.LIST, (short)3);
29
  private static final org.apache.thrift.protocol.TField SUPPLIER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supplierId", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)6);
32
  private static final org.apache.thrift.protocol.TField CREATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("createdAt", org.apache.thrift.protocol.TType.I64, (short)7);
33
  private static final org.apache.thrift.protocol.TField UPDATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedAt", org.apache.thrift.protocol.TType.I64, (short)8);
34
  private static final org.apache.thrift.protocol.TField TOTAL_COST_FIELD_DESC = new org.apache.thrift.protocol.TField("totalCost", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
35
  private static final org.apache.thrift.protocol.TField FREIGHT_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("freightCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)10);
36
  private static final org.apache.thrift.protocol.TField REALIZED_COST_FIELD_DESC = new org.apache.thrift.protocol.TField("realizedCost", org.apache.thrift.protocol.TType.DOUBLE, (short)11);
37
  private static final org.apache.thrift.protocol.TField REALIZED_FREIGHT_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("realizedFreightCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)12);
6821 amar.kumar 38
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)13);
9416 amar.kumar 39
  private static final org.apache.thrift.protocol.TField TAX_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("taxType", org.apache.thrift.protocol.TType.I32, (short)14);
4496 mandeep.dh 40
 
41
  private long id; // required
42
  private String poNumber; // required
43
  private List<LineItem> lineitems; // required
44
  private long supplierId; // required
45
  private long warehouseId; // required
46
  private POStatus status; // required
47
  private long createdAt; // required
48
  private long updatedAt; // required
49
  private double totalCost; // required
50
  private double freightCharges; // required
51
  private double realizedCost; // required
52
  private double realizedFreightCharges; // required
6821 amar.kumar 53
  private POType type; // required
9416 amar.kumar 54
  private TaxType taxType; // required
4496 mandeep.dh 55
 
56
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
57
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
58
    ID((short)1, "id"),
59
    PO_NUMBER((short)2, "poNumber"),
60
    LINEITEMS((short)3, "lineitems"),
61
    SUPPLIER_ID((short)4, "supplierId"),
62
    WAREHOUSE_ID((short)5, "warehouseId"),
63
    /**
64
     * 
65
     * @see POStatus
66
     */
67
    STATUS((short)6, "status"),
68
    CREATED_AT((short)7, "createdAt"),
69
    UPDATED_AT((short)8, "updatedAt"),
70
    TOTAL_COST((short)9, "totalCost"),
71
    FREIGHT_CHARGES((short)10, "freightCharges"),
72
    REALIZED_COST((short)11, "realizedCost"),
6821 amar.kumar 73
    REALIZED_FREIGHT_CHARGES((short)12, "realizedFreightCharges"),
74
    /**
75
     * 
76
     * @see POType
77
     */
9416 amar.kumar 78
    TYPE((short)13, "type"),
79
    /**
80
     * 
81
     * @see TaxType
82
     */
83
    TAX_TYPE((short)14, "taxType");
4496 mandeep.dh 84
 
85
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
86
 
87
    static {
88
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
89
        byName.put(field.getFieldName(), field);
90
      }
91
    }
92
 
93
    /**
94
     * Find the _Fields constant that matches fieldId, or null if its not found.
95
     */
96
    public static _Fields findByThriftId(int fieldId) {
97
      switch(fieldId) {
98
        case 1: // ID
99
          return ID;
100
        case 2: // PO_NUMBER
101
          return PO_NUMBER;
102
        case 3: // LINEITEMS
103
          return LINEITEMS;
104
        case 4: // SUPPLIER_ID
105
          return SUPPLIER_ID;
106
        case 5: // WAREHOUSE_ID
107
          return WAREHOUSE_ID;
108
        case 6: // STATUS
109
          return STATUS;
110
        case 7: // CREATED_AT
111
          return CREATED_AT;
112
        case 8: // UPDATED_AT
113
          return UPDATED_AT;
114
        case 9: // TOTAL_COST
115
          return TOTAL_COST;
116
        case 10: // FREIGHT_CHARGES
117
          return FREIGHT_CHARGES;
118
        case 11: // REALIZED_COST
119
          return REALIZED_COST;
120
        case 12: // REALIZED_FREIGHT_CHARGES
121
          return REALIZED_FREIGHT_CHARGES;
6821 amar.kumar 122
        case 13: // TYPE
123
          return TYPE;
9416 amar.kumar 124
        case 14: // TAX_TYPE
125
          return TAX_TYPE;
4496 mandeep.dh 126
        default:
127
          return null;
128
      }
129
    }
130
 
131
    /**
132
     * Find the _Fields constant that matches fieldId, throwing an exception
133
     * if it is not found.
134
     */
135
    public static _Fields findByThriftIdOrThrow(int fieldId) {
136
      _Fields fields = findByThriftId(fieldId);
137
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
138
      return fields;
139
    }
140
 
141
    /**
142
     * Find the _Fields constant that matches name, or null if its not found.
143
     */
144
    public static _Fields findByName(String name) {
145
      return byName.get(name);
146
    }
147
 
148
    private final short _thriftId;
149
    private final String _fieldName;
150
 
151
    _Fields(short thriftId, String fieldName) {
152
      _thriftId = thriftId;
153
      _fieldName = fieldName;
154
    }
155
 
156
    public short getThriftFieldId() {
157
      return _thriftId;
158
    }
159
 
160
    public String getFieldName() {
161
      return _fieldName;
162
    }
163
  }
164
 
165
  // isset id assignments
166
  private static final int __ID_ISSET_ID = 0;
167
  private static final int __SUPPLIERID_ISSET_ID = 1;
168
  private static final int __WAREHOUSEID_ISSET_ID = 2;
169
  private static final int __CREATEDAT_ISSET_ID = 3;
170
  private static final int __UPDATEDAT_ISSET_ID = 4;
171
  private static final int __TOTALCOST_ISSET_ID = 5;
172
  private static final int __FREIGHTCHARGES_ISSET_ID = 6;
173
  private static final int __REALIZEDCOST_ISSET_ID = 7;
174
  private static final int __REALIZEDFREIGHTCHARGES_ISSET_ID = 8;
175
  private BitSet __isset_bit_vector = new BitSet(9);
176
 
177
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
178
  static {
179
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
180
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
181
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
182
    tmpMap.put(_Fields.PO_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("poNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
183
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
184
    tmpMap.put(_Fields.LINEITEMS, new org.apache.thrift.meta_data.FieldMetaData("lineitems", org.apache.thrift.TFieldRequirementType.DEFAULT, 
185
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
186
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LineItem.class))));
187
    tmpMap.put(_Fields.SUPPLIER_ID, new org.apache.thrift.meta_data.FieldMetaData("supplierId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
188
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
189
    tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
190
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
191
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
192
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, POStatus.class)));
193
    tmpMap.put(_Fields.CREATED_AT, new org.apache.thrift.meta_data.FieldMetaData("createdAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
194
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
195
    tmpMap.put(_Fields.UPDATED_AT, new org.apache.thrift.meta_data.FieldMetaData("updatedAt", org.apache.thrift.TFieldRequirementType.DEFAULT, 
196
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
197
    tmpMap.put(_Fields.TOTAL_COST, new org.apache.thrift.meta_data.FieldMetaData("totalCost", org.apache.thrift.TFieldRequirementType.DEFAULT, 
198
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
199
    tmpMap.put(_Fields.FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("freightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
200
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
201
    tmpMap.put(_Fields.REALIZED_COST, new org.apache.thrift.meta_data.FieldMetaData("realizedCost", org.apache.thrift.TFieldRequirementType.DEFAULT, 
202
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
203
    tmpMap.put(_Fields.REALIZED_FREIGHT_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("realizedFreightCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
204
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
6821 amar.kumar 205
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
206
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, POType.class)));
9416 amar.kumar 207
    tmpMap.put(_Fields.TAX_TYPE, new org.apache.thrift.meta_data.FieldMetaData("taxType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
208
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TaxType.class)));
4496 mandeep.dh 209
    metaDataMap = Collections.unmodifiableMap(tmpMap);
210
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseOrder.class, metaDataMap);
211
  }
212
 
213
  public PurchaseOrder() {
214
  }
215
 
216
  public PurchaseOrder(
217
    long id,
218
    String poNumber,
219
    List<LineItem> lineitems,
220
    long supplierId,
221
    long warehouseId,
222
    POStatus status,
223
    long createdAt,
224
    long updatedAt,
225
    double totalCost,
226
    double freightCharges,
227
    double realizedCost,
6821 amar.kumar 228
    double realizedFreightCharges,
9416 amar.kumar 229
    POType type,
230
    TaxType taxType)
4496 mandeep.dh 231
  {
232
    this();
233
    this.id = id;
234
    setIdIsSet(true);
235
    this.poNumber = poNumber;
236
    this.lineitems = lineitems;
237
    this.supplierId = supplierId;
238
    setSupplierIdIsSet(true);
239
    this.warehouseId = warehouseId;
240
    setWarehouseIdIsSet(true);
241
    this.status = status;
242
    this.createdAt = createdAt;
243
    setCreatedAtIsSet(true);
244
    this.updatedAt = updatedAt;
245
    setUpdatedAtIsSet(true);
246
    this.totalCost = totalCost;
247
    setTotalCostIsSet(true);
248
    this.freightCharges = freightCharges;
249
    setFreightChargesIsSet(true);
250
    this.realizedCost = realizedCost;
251
    setRealizedCostIsSet(true);
252
    this.realizedFreightCharges = realizedFreightCharges;
253
    setRealizedFreightChargesIsSet(true);
6821 amar.kumar 254
    this.type = type;
9416 amar.kumar 255
    this.taxType = taxType;
4496 mandeep.dh 256
  }
257
 
258
  /**
259
   * Performs a deep copy on <i>other</i>.
260
   */
261
  public PurchaseOrder(PurchaseOrder other) {
262
    __isset_bit_vector.clear();
263
    __isset_bit_vector.or(other.__isset_bit_vector);
264
    this.id = other.id;
265
    if (other.isSetPoNumber()) {
266
      this.poNumber = other.poNumber;
267
    }
268
    if (other.isSetLineitems()) {
269
      List<LineItem> __this__lineitems = new ArrayList<LineItem>();
270
      for (LineItem other_element : other.lineitems) {
271
        __this__lineitems.add(new LineItem(other_element));
272
      }
273
      this.lineitems = __this__lineitems;
274
    }
275
    this.supplierId = other.supplierId;
276
    this.warehouseId = other.warehouseId;
277
    if (other.isSetStatus()) {
278
      this.status = other.status;
279
    }
280
    this.createdAt = other.createdAt;
281
    this.updatedAt = other.updatedAt;
282
    this.totalCost = other.totalCost;
283
    this.freightCharges = other.freightCharges;
284
    this.realizedCost = other.realizedCost;
285
    this.realizedFreightCharges = other.realizedFreightCharges;
6821 amar.kumar 286
    if (other.isSetType()) {
287
      this.type = other.type;
288
    }
9416 amar.kumar 289
    if (other.isSetTaxType()) {
290
      this.taxType = other.taxType;
291
    }
4496 mandeep.dh 292
  }
293
 
294
  public PurchaseOrder deepCopy() {
295
    return new PurchaseOrder(this);
296
  }
297
 
298
  @Override
299
  public void clear() {
300
    setIdIsSet(false);
301
    this.id = 0;
302
    this.poNumber = null;
303
    this.lineitems = null;
304
    setSupplierIdIsSet(false);
305
    this.supplierId = 0;
306
    setWarehouseIdIsSet(false);
307
    this.warehouseId = 0;
308
    this.status = null;
309
    setCreatedAtIsSet(false);
310
    this.createdAt = 0;
311
    setUpdatedAtIsSet(false);
312
    this.updatedAt = 0;
313
    setTotalCostIsSet(false);
314
    this.totalCost = 0.0;
315
    setFreightChargesIsSet(false);
316
    this.freightCharges = 0.0;
317
    setRealizedCostIsSet(false);
318
    this.realizedCost = 0.0;
319
    setRealizedFreightChargesIsSet(false);
320
    this.realizedFreightCharges = 0.0;
6821 amar.kumar 321
    this.type = null;
9416 amar.kumar 322
    this.taxType = null;
4496 mandeep.dh 323
  }
324
 
325
  public long getId() {
326
    return this.id;
327
  }
328
 
329
  public void setId(long id) {
330
    this.id = id;
331
    setIdIsSet(true);
332
  }
333
 
334
  public void unsetId() {
335
    __isset_bit_vector.clear(__ID_ISSET_ID);
336
  }
337
 
338
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
339
  public boolean isSetId() {
340
    return __isset_bit_vector.get(__ID_ISSET_ID);
341
  }
342
 
343
  public void setIdIsSet(boolean value) {
344
    __isset_bit_vector.set(__ID_ISSET_ID, value);
345
  }
346
 
347
  public String getPoNumber() {
348
    return this.poNumber;
349
  }
350
 
351
  public void setPoNumber(String poNumber) {
352
    this.poNumber = poNumber;
353
  }
354
 
355
  public void unsetPoNumber() {
356
    this.poNumber = null;
357
  }
358
 
359
  /** Returns true if field poNumber is set (has been assigned a value) and false otherwise */
360
  public boolean isSetPoNumber() {
361
    return this.poNumber != null;
362
  }
363
 
364
  public void setPoNumberIsSet(boolean value) {
365
    if (!value) {
366
      this.poNumber = null;
367
    }
368
  }
369
 
370
  public int getLineitemsSize() {
371
    return (this.lineitems == null) ? 0 : this.lineitems.size();
372
  }
373
 
374
  public java.util.Iterator<LineItem> getLineitemsIterator() {
375
    return (this.lineitems == null) ? null : this.lineitems.iterator();
376
  }
377
 
378
  public void addToLineitems(LineItem elem) {
379
    if (this.lineitems == null) {
380
      this.lineitems = new ArrayList<LineItem>();
381
    }
382
    this.lineitems.add(elem);
383
  }
384
 
385
  public List<LineItem> getLineitems() {
386
    return this.lineitems;
387
  }
388
 
389
  public void setLineitems(List<LineItem> lineitems) {
390
    this.lineitems = lineitems;
391
  }
392
 
393
  public void unsetLineitems() {
394
    this.lineitems = null;
395
  }
396
 
397
  /** Returns true if field lineitems is set (has been assigned a value) and false otherwise */
398
  public boolean isSetLineitems() {
399
    return this.lineitems != null;
400
  }
401
 
402
  public void setLineitemsIsSet(boolean value) {
403
    if (!value) {
404
      this.lineitems = null;
405
    }
406
  }
407
 
408
  public long getSupplierId() {
409
    return this.supplierId;
410
  }
411
 
412
  public void setSupplierId(long supplierId) {
413
    this.supplierId = supplierId;
414
    setSupplierIdIsSet(true);
415
  }
416
 
417
  public void unsetSupplierId() {
418
    __isset_bit_vector.clear(__SUPPLIERID_ISSET_ID);
419
  }
420
 
421
  /** Returns true if field supplierId is set (has been assigned a value) and false otherwise */
422
  public boolean isSetSupplierId() {
423
    return __isset_bit_vector.get(__SUPPLIERID_ISSET_ID);
424
  }
425
 
426
  public void setSupplierIdIsSet(boolean value) {
427
    __isset_bit_vector.set(__SUPPLIERID_ISSET_ID, value);
428
  }
429
 
430
  public long getWarehouseId() {
431
    return this.warehouseId;
432
  }
433
 
434
  public void setWarehouseId(long warehouseId) {
435
    this.warehouseId = warehouseId;
436
    setWarehouseIdIsSet(true);
437
  }
438
 
439
  public void unsetWarehouseId() {
440
    __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
441
  }
442
 
443
  /** Returns true if field warehouseId is set (has been assigned a value) and false otherwise */
444
  public boolean isSetWarehouseId() {
445
    return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
446
  }
447
 
448
  public void setWarehouseIdIsSet(boolean value) {
449
    __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
450
  }
451
 
452
  /**
453
   * 
454
   * @see POStatus
455
   */
456
  public POStatus getStatus() {
457
    return this.status;
458
  }
459
 
460
  /**
461
   * 
462
   * @see POStatus
463
   */
464
  public void setStatus(POStatus status) {
465
    this.status = status;
466
  }
467
 
468
  public void unsetStatus() {
469
    this.status = null;
470
  }
471
 
472
  /** Returns true if field status is set (has been assigned a value) and false otherwise */
473
  public boolean isSetStatus() {
474
    return this.status != null;
475
  }
476
 
477
  public void setStatusIsSet(boolean value) {
478
    if (!value) {
479
      this.status = null;
480
    }
481
  }
482
 
483
  public long getCreatedAt() {
484
    return this.createdAt;
485
  }
486
 
487
  public void setCreatedAt(long createdAt) {
488
    this.createdAt = createdAt;
489
    setCreatedAtIsSet(true);
490
  }
491
 
492
  public void unsetCreatedAt() {
493
    __isset_bit_vector.clear(__CREATEDAT_ISSET_ID);
494
  }
495
 
496
  /** Returns true if field createdAt is set (has been assigned a value) and false otherwise */
497
  public boolean isSetCreatedAt() {
498
    return __isset_bit_vector.get(__CREATEDAT_ISSET_ID);
499
  }
500
 
501
  public void setCreatedAtIsSet(boolean value) {
502
    __isset_bit_vector.set(__CREATEDAT_ISSET_ID, value);
503
  }
504
 
505
  public long getUpdatedAt() {
506
    return this.updatedAt;
507
  }
508
 
509
  public void setUpdatedAt(long updatedAt) {
510
    this.updatedAt = updatedAt;
511
    setUpdatedAtIsSet(true);
512
  }
513
 
514
  public void unsetUpdatedAt() {
515
    __isset_bit_vector.clear(__UPDATEDAT_ISSET_ID);
516
  }
517
 
518
  /** Returns true if field updatedAt is set (has been assigned a value) and false otherwise */
519
  public boolean isSetUpdatedAt() {
520
    return __isset_bit_vector.get(__UPDATEDAT_ISSET_ID);
521
  }
522
 
523
  public void setUpdatedAtIsSet(boolean value) {
524
    __isset_bit_vector.set(__UPDATEDAT_ISSET_ID, value);
525
  }
526
 
527
  public double getTotalCost() {
528
    return this.totalCost;
529
  }
530
 
531
  public void setTotalCost(double totalCost) {
532
    this.totalCost = totalCost;
533
    setTotalCostIsSet(true);
534
  }
535
 
536
  public void unsetTotalCost() {
537
    __isset_bit_vector.clear(__TOTALCOST_ISSET_ID);
538
  }
539
 
540
  /** Returns true if field totalCost is set (has been assigned a value) and false otherwise */
541
  public boolean isSetTotalCost() {
542
    return __isset_bit_vector.get(__TOTALCOST_ISSET_ID);
543
  }
544
 
545
  public void setTotalCostIsSet(boolean value) {
546
    __isset_bit_vector.set(__TOTALCOST_ISSET_ID, value);
547
  }
548
 
549
  public double getFreightCharges() {
550
    return this.freightCharges;
551
  }
552
 
553
  public void setFreightCharges(double freightCharges) {
554
    this.freightCharges = freightCharges;
555
    setFreightChargesIsSet(true);
556
  }
557
 
558
  public void unsetFreightCharges() {
559
    __isset_bit_vector.clear(__FREIGHTCHARGES_ISSET_ID);
560
  }
561
 
562
  /** Returns true if field freightCharges is set (has been assigned a value) and false otherwise */
563
  public boolean isSetFreightCharges() {
564
    return __isset_bit_vector.get(__FREIGHTCHARGES_ISSET_ID);
565
  }
566
 
567
  public void setFreightChargesIsSet(boolean value) {
568
    __isset_bit_vector.set(__FREIGHTCHARGES_ISSET_ID, value);
569
  }
570
 
571
  public double getRealizedCost() {
572
    return this.realizedCost;
573
  }
574
 
575
  public void setRealizedCost(double realizedCost) {
576
    this.realizedCost = realizedCost;
577
    setRealizedCostIsSet(true);
578
  }
579
 
580
  public void unsetRealizedCost() {
581
    __isset_bit_vector.clear(__REALIZEDCOST_ISSET_ID);
582
  }
583
 
584
  /** Returns true if field realizedCost is set (has been assigned a value) and false otherwise */
585
  public boolean isSetRealizedCost() {
586
    return __isset_bit_vector.get(__REALIZEDCOST_ISSET_ID);
587
  }
588
 
589
  public void setRealizedCostIsSet(boolean value) {
590
    __isset_bit_vector.set(__REALIZEDCOST_ISSET_ID, value);
591
  }
592
 
593
  public double getRealizedFreightCharges() {
594
    return this.realizedFreightCharges;
595
  }
596
 
597
  public void setRealizedFreightCharges(double realizedFreightCharges) {
598
    this.realizedFreightCharges = realizedFreightCharges;
599
    setRealizedFreightChargesIsSet(true);
600
  }
601
 
602
  public void unsetRealizedFreightCharges() {
603
    __isset_bit_vector.clear(__REALIZEDFREIGHTCHARGES_ISSET_ID);
604
  }
605
 
606
  /** Returns true if field realizedFreightCharges is set (has been assigned a value) and false otherwise */
607
  public boolean isSetRealizedFreightCharges() {
608
    return __isset_bit_vector.get(__REALIZEDFREIGHTCHARGES_ISSET_ID);
609
  }
610
 
611
  public void setRealizedFreightChargesIsSet(boolean value) {
612
    __isset_bit_vector.set(__REALIZEDFREIGHTCHARGES_ISSET_ID, value);
613
  }
614
 
6821 amar.kumar 615
  /**
616
   * 
617
   * @see POType
618
   */
619
  public POType getType() {
620
    return this.type;
621
  }
622
 
623
  /**
624
   * 
625
   * @see POType
626
   */
627
  public void setType(POType type) {
628
    this.type = type;
629
  }
630
 
631
  public void unsetType() {
632
    this.type = null;
633
  }
634
 
635
  /** Returns true if field type is set (has been assigned a value) and false otherwise */
636
  public boolean isSetType() {
637
    return this.type != null;
638
  }
639
 
640
  public void setTypeIsSet(boolean value) {
641
    if (!value) {
642
      this.type = null;
643
    }
644
  }
645
 
9416 amar.kumar 646
  /**
647
   * 
648
   * @see TaxType
649
   */
650
  public TaxType getTaxType() {
651
    return this.taxType;
652
  }
653
 
654
  /**
655
   * 
656
   * @see TaxType
657
   */
658
  public void setTaxType(TaxType taxType) {
659
    this.taxType = taxType;
660
  }
661
 
662
  public void unsetTaxType() {
663
    this.taxType = null;
664
  }
665
 
666
  /** Returns true if field taxType is set (has been assigned a value) and false otherwise */
667
  public boolean isSetTaxType() {
668
    return this.taxType != null;
669
  }
670
 
671
  public void setTaxTypeIsSet(boolean value) {
672
    if (!value) {
673
      this.taxType = null;
674
    }
675
  }
676
 
4496 mandeep.dh 677
  public void setFieldValue(_Fields field, Object value) {
678
    switch (field) {
679
    case ID:
680
      if (value == null) {
681
        unsetId();
682
      } else {
683
        setId((Long)value);
684
      }
685
      break;
686
 
687
    case PO_NUMBER:
688
      if (value == null) {
689
        unsetPoNumber();
690
      } else {
691
        setPoNumber((String)value);
692
      }
693
      break;
694
 
695
    case LINEITEMS:
696
      if (value == null) {
697
        unsetLineitems();
698
      } else {
699
        setLineitems((List<LineItem>)value);
700
      }
701
      break;
702
 
703
    case SUPPLIER_ID:
704
      if (value == null) {
705
        unsetSupplierId();
706
      } else {
707
        setSupplierId((Long)value);
708
      }
709
      break;
710
 
711
    case WAREHOUSE_ID:
712
      if (value == null) {
713
        unsetWarehouseId();
714
      } else {
715
        setWarehouseId((Long)value);
716
      }
717
      break;
718
 
719
    case STATUS:
720
      if (value == null) {
721
        unsetStatus();
722
      } else {
723
        setStatus((POStatus)value);
724
      }
725
      break;
726
 
727
    case CREATED_AT:
728
      if (value == null) {
729
        unsetCreatedAt();
730
      } else {
731
        setCreatedAt((Long)value);
732
      }
733
      break;
734
 
735
    case UPDATED_AT:
736
      if (value == null) {
737
        unsetUpdatedAt();
738
      } else {
739
        setUpdatedAt((Long)value);
740
      }
741
      break;
742
 
743
    case TOTAL_COST:
744
      if (value == null) {
745
        unsetTotalCost();
746
      } else {
747
        setTotalCost((Double)value);
748
      }
749
      break;
750
 
751
    case FREIGHT_CHARGES:
752
      if (value == null) {
753
        unsetFreightCharges();
754
      } else {
755
        setFreightCharges((Double)value);
756
      }
757
      break;
758
 
759
    case REALIZED_COST:
760
      if (value == null) {
761
        unsetRealizedCost();
762
      } else {
763
        setRealizedCost((Double)value);
764
      }
765
      break;
766
 
767
    case REALIZED_FREIGHT_CHARGES:
768
      if (value == null) {
769
        unsetRealizedFreightCharges();
770
      } else {
771
        setRealizedFreightCharges((Double)value);
772
      }
773
      break;
774
 
6821 amar.kumar 775
    case TYPE:
776
      if (value == null) {
777
        unsetType();
778
      } else {
779
        setType((POType)value);
780
      }
781
      break;
782
 
9416 amar.kumar 783
    case TAX_TYPE:
784
      if (value == null) {
785
        unsetTaxType();
786
      } else {
787
        setTaxType((TaxType)value);
788
      }
789
      break;
790
 
4496 mandeep.dh 791
    }
792
  }
793
 
794
  public Object getFieldValue(_Fields field) {
795
    switch (field) {
796
    case ID:
797
      return Long.valueOf(getId());
798
 
799
    case PO_NUMBER:
800
      return getPoNumber();
801
 
802
    case LINEITEMS:
803
      return getLineitems();
804
 
805
    case SUPPLIER_ID:
806
      return Long.valueOf(getSupplierId());
807
 
808
    case WAREHOUSE_ID:
809
      return Long.valueOf(getWarehouseId());
810
 
811
    case STATUS:
812
      return getStatus();
813
 
814
    case CREATED_AT:
815
      return Long.valueOf(getCreatedAt());
816
 
817
    case UPDATED_AT:
818
      return Long.valueOf(getUpdatedAt());
819
 
820
    case TOTAL_COST:
821
      return Double.valueOf(getTotalCost());
822
 
823
    case FREIGHT_CHARGES:
824
      return Double.valueOf(getFreightCharges());
825
 
826
    case REALIZED_COST:
827
      return Double.valueOf(getRealizedCost());
828
 
829
    case REALIZED_FREIGHT_CHARGES:
830
      return Double.valueOf(getRealizedFreightCharges());
831
 
6821 amar.kumar 832
    case TYPE:
833
      return getType();
834
 
9416 amar.kumar 835
    case TAX_TYPE:
836
      return getTaxType();
837
 
4496 mandeep.dh 838
    }
839
    throw new IllegalStateException();
840
  }
841
 
842
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
843
  public boolean isSet(_Fields field) {
844
    if (field == null) {
845
      throw new IllegalArgumentException();
846
    }
847
 
848
    switch (field) {
849
    case ID:
850
      return isSetId();
851
    case PO_NUMBER:
852
      return isSetPoNumber();
853
    case LINEITEMS:
854
      return isSetLineitems();
855
    case SUPPLIER_ID:
856
      return isSetSupplierId();
857
    case WAREHOUSE_ID:
858
      return isSetWarehouseId();
859
    case STATUS:
860
      return isSetStatus();
861
    case CREATED_AT:
862
      return isSetCreatedAt();
863
    case UPDATED_AT:
864
      return isSetUpdatedAt();
865
    case TOTAL_COST:
866
      return isSetTotalCost();
867
    case FREIGHT_CHARGES:
868
      return isSetFreightCharges();
869
    case REALIZED_COST:
870
      return isSetRealizedCost();
871
    case REALIZED_FREIGHT_CHARGES:
872
      return isSetRealizedFreightCharges();
6821 amar.kumar 873
    case TYPE:
874
      return isSetType();
9416 amar.kumar 875
    case TAX_TYPE:
876
      return isSetTaxType();
4496 mandeep.dh 877
    }
878
    throw new IllegalStateException();
879
  }
880
 
881
  @Override
882
  public boolean equals(Object that) {
883
    if (that == null)
884
      return false;
885
    if (that instanceof PurchaseOrder)
886
      return this.equals((PurchaseOrder)that);
887
    return false;
888
  }
889
 
890
  public boolean equals(PurchaseOrder that) {
891
    if (that == null)
892
      return false;
893
 
894
    boolean this_present_id = true;
895
    boolean that_present_id = true;
896
    if (this_present_id || that_present_id) {
897
      if (!(this_present_id && that_present_id))
898
        return false;
899
      if (this.id != that.id)
900
        return false;
901
    }
902
 
903
    boolean this_present_poNumber = true && this.isSetPoNumber();
904
    boolean that_present_poNumber = true && that.isSetPoNumber();
905
    if (this_present_poNumber || that_present_poNumber) {
906
      if (!(this_present_poNumber && that_present_poNumber))
907
        return false;
908
      if (!this.poNumber.equals(that.poNumber))
909
        return false;
910
    }
911
 
912
    boolean this_present_lineitems = true && this.isSetLineitems();
913
    boolean that_present_lineitems = true && that.isSetLineitems();
914
    if (this_present_lineitems || that_present_lineitems) {
915
      if (!(this_present_lineitems && that_present_lineitems))
916
        return false;
917
      if (!this.lineitems.equals(that.lineitems))
918
        return false;
919
    }
920
 
921
    boolean this_present_supplierId = true;
922
    boolean that_present_supplierId = true;
923
    if (this_present_supplierId || that_present_supplierId) {
924
      if (!(this_present_supplierId && that_present_supplierId))
925
        return false;
926
      if (this.supplierId != that.supplierId)
927
        return false;
928
    }
929
 
930
    boolean this_present_warehouseId = true;
931
    boolean that_present_warehouseId = true;
932
    if (this_present_warehouseId || that_present_warehouseId) {
933
      if (!(this_present_warehouseId && that_present_warehouseId))
934
        return false;
935
      if (this.warehouseId != that.warehouseId)
936
        return false;
937
    }
938
 
939
    boolean this_present_status = true && this.isSetStatus();
940
    boolean that_present_status = true && that.isSetStatus();
941
    if (this_present_status || that_present_status) {
942
      if (!(this_present_status && that_present_status))
943
        return false;
944
      if (!this.status.equals(that.status))
945
        return false;
946
    }
947
 
948
    boolean this_present_createdAt = true;
949
    boolean that_present_createdAt = true;
950
    if (this_present_createdAt || that_present_createdAt) {
951
      if (!(this_present_createdAt && that_present_createdAt))
952
        return false;
953
      if (this.createdAt != that.createdAt)
954
        return false;
955
    }
956
 
957
    boolean this_present_updatedAt = true;
958
    boolean that_present_updatedAt = true;
959
    if (this_present_updatedAt || that_present_updatedAt) {
960
      if (!(this_present_updatedAt && that_present_updatedAt))
961
        return false;
962
      if (this.updatedAt != that.updatedAt)
963
        return false;
964
    }
965
 
966
    boolean this_present_totalCost = true;
967
    boolean that_present_totalCost = true;
968
    if (this_present_totalCost || that_present_totalCost) {
969
      if (!(this_present_totalCost && that_present_totalCost))
970
        return false;
971
      if (this.totalCost != that.totalCost)
972
        return false;
973
    }
974
 
975
    boolean this_present_freightCharges = true;
976
    boolean that_present_freightCharges = true;
977
    if (this_present_freightCharges || that_present_freightCharges) {
978
      if (!(this_present_freightCharges && that_present_freightCharges))
979
        return false;
980
      if (this.freightCharges != that.freightCharges)
981
        return false;
982
    }
983
 
984
    boolean this_present_realizedCost = true;
985
    boolean that_present_realizedCost = true;
986
    if (this_present_realizedCost || that_present_realizedCost) {
987
      if (!(this_present_realizedCost && that_present_realizedCost))
988
        return false;
989
      if (this.realizedCost != that.realizedCost)
990
        return false;
991
    }
992
 
993
    boolean this_present_realizedFreightCharges = true;
994
    boolean that_present_realizedFreightCharges = true;
995
    if (this_present_realizedFreightCharges || that_present_realizedFreightCharges) {
996
      if (!(this_present_realizedFreightCharges && that_present_realizedFreightCharges))
997
        return false;
998
      if (this.realizedFreightCharges != that.realizedFreightCharges)
999
        return false;
1000
    }
1001
 
6821 amar.kumar 1002
    boolean this_present_type = true && this.isSetType();
1003
    boolean that_present_type = true && that.isSetType();
1004
    if (this_present_type || that_present_type) {
1005
      if (!(this_present_type && that_present_type))
1006
        return false;
1007
      if (!this.type.equals(that.type))
1008
        return false;
1009
    }
1010
 
9416 amar.kumar 1011
    boolean this_present_taxType = true && this.isSetTaxType();
1012
    boolean that_present_taxType = true && that.isSetTaxType();
1013
    if (this_present_taxType || that_present_taxType) {
1014
      if (!(this_present_taxType && that_present_taxType))
1015
        return false;
1016
      if (!this.taxType.equals(that.taxType))
1017
        return false;
1018
    }
1019
 
4496 mandeep.dh 1020
    return true;
1021
  }
1022
 
1023
  @Override
1024
  public int hashCode() {
1025
    return 0;
1026
  }
1027
 
1028
  public int compareTo(PurchaseOrder other) {
1029
    if (!getClass().equals(other.getClass())) {
1030
      return getClass().getName().compareTo(other.getClass().getName());
1031
    }
1032
 
1033
    int lastComparison = 0;
1034
    PurchaseOrder typedOther = (PurchaseOrder)other;
1035
 
1036
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
1037
    if (lastComparison != 0) {
1038
      return lastComparison;
1039
    }
1040
    if (isSetId()) {
1041
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
1042
      if (lastComparison != 0) {
1043
        return lastComparison;
1044
      }
1045
    }
1046
    lastComparison = Boolean.valueOf(isSetPoNumber()).compareTo(typedOther.isSetPoNumber());
1047
    if (lastComparison != 0) {
1048
      return lastComparison;
1049
    }
1050
    if (isSetPoNumber()) {
1051
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.poNumber, typedOther.poNumber);
1052
      if (lastComparison != 0) {
1053
        return lastComparison;
1054
      }
1055
    }
1056
    lastComparison = Boolean.valueOf(isSetLineitems()).compareTo(typedOther.isSetLineitems());
1057
    if (lastComparison != 0) {
1058
      return lastComparison;
1059
    }
1060
    if (isSetLineitems()) {
1061
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lineitems, typedOther.lineitems);
1062
      if (lastComparison != 0) {
1063
        return lastComparison;
1064
      }
1065
    }
1066
    lastComparison = Boolean.valueOf(isSetSupplierId()).compareTo(typedOther.isSetSupplierId());
1067
    if (lastComparison != 0) {
1068
      return lastComparison;
1069
    }
1070
    if (isSetSupplierId()) {
1071
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supplierId, typedOther.supplierId);
1072
      if (lastComparison != 0) {
1073
        return lastComparison;
1074
      }
1075
    }
1076
    lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
1077
    if (lastComparison != 0) {
1078
      return lastComparison;
1079
    }
1080
    if (isSetWarehouseId()) {
1081
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
1082
      if (lastComparison != 0) {
1083
        return lastComparison;
1084
      }
1085
    }
1086
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
1087
    if (lastComparison != 0) {
1088
      return lastComparison;
1089
    }
1090
    if (isSetStatus()) {
1091
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
1092
      if (lastComparison != 0) {
1093
        return lastComparison;
1094
      }
1095
    }
1096
    lastComparison = Boolean.valueOf(isSetCreatedAt()).compareTo(typedOther.isSetCreatedAt());
1097
    if (lastComparison != 0) {
1098
      return lastComparison;
1099
    }
1100
    if (isSetCreatedAt()) {
1101
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createdAt, typedOther.createdAt);
1102
      if (lastComparison != 0) {
1103
        return lastComparison;
1104
      }
1105
    }
1106
    lastComparison = Boolean.valueOf(isSetUpdatedAt()).compareTo(typedOther.isSetUpdatedAt());
1107
    if (lastComparison != 0) {
1108
      return lastComparison;
1109
    }
1110
    if (isSetUpdatedAt()) {
1111
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedAt, typedOther.updatedAt);
1112
      if (lastComparison != 0) {
1113
        return lastComparison;
1114
      }
1115
    }
1116
    lastComparison = Boolean.valueOf(isSetTotalCost()).compareTo(typedOther.isSetTotalCost());
1117
    if (lastComparison != 0) {
1118
      return lastComparison;
1119
    }
1120
    if (isSetTotalCost()) {
1121
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalCost, typedOther.totalCost);
1122
      if (lastComparison != 0) {
1123
        return lastComparison;
1124
      }
1125
    }
1126
    lastComparison = Boolean.valueOf(isSetFreightCharges()).compareTo(typedOther.isSetFreightCharges());
1127
    if (lastComparison != 0) {
1128
      return lastComparison;
1129
    }
1130
    if (isSetFreightCharges()) {
1131
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freightCharges, typedOther.freightCharges);
1132
      if (lastComparison != 0) {
1133
        return lastComparison;
1134
      }
1135
    }
1136
    lastComparison = Boolean.valueOf(isSetRealizedCost()).compareTo(typedOther.isSetRealizedCost());
1137
    if (lastComparison != 0) {
1138
      return lastComparison;
1139
    }
1140
    if (isSetRealizedCost()) {
1141
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.realizedCost, typedOther.realizedCost);
1142
      if (lastComparison != 0) {
1143
        return lastComparison;
1144
      }
1145
    }
1146
    lastComparison = Boolean.valueOf(isSetRealizedFreightCharges()).compareTo(typedOther.isSetRealizedFreightCharges());
1147
    if (lastComparison != 0) {
1148
      return lastComparison;
1149
    }
1150
    if (isSetRealizedFreightCharges()) {
1151
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.realizedFreightCharges, typedOther.realizedFreightCharges);
1152
      if (lastComparison != 0) {
1153
        return lastComparison;
1154
      }
1155
    }
6821 amar.kumar 1156
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
1157
    if (lastComparison != 0) {
1158
      return lastComparison;
1159
    }
1160
    if (isSetType()) {
1161
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
1162
      if (lastComparison != 0) {
1163
        return lastComparison;
1164
      }
1165
    }
9416 amar.kumar 1166
    lastComparison = Boolean.valueOf(isSetTaxType()).compareTo(typedOther.isSetTaxType());
1167
    if (lastComparison != 0) {
1168
      return lastComparison;
1169
    }
1170
    if (isSetTaxType()) {
1171
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taxType, typedOther.taxType);
1172
      if (lastComparison != 0) {
1173
        return lastComparison;
1174
      }
1175
    }
4496 mandeep.dh 1176
    return 0;
1177
  }
1178
 
1179
  public _Fields fieldForId(int fieldId) {
1180
    return _Fields.findByThriftId(fieldId);
1181
  }
1182
 
1183
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
1184
    org.apache.thrift.protocol.TField field;
1185
    iprot.readStructBegin();
1186
    while (true)
1187
    {
1188
      field = iprot.readFieldBegin();
1189
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1190
        break;
1191
      }
1192
      switch (field.id) {
1193
        case 1: // ID
1194
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1195
            this.id = iprot.readI64();
1196
            setIdIsSet(true);
1197
          } else { 
1198
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1199
          }
1200
          break;
1201
        case 2: // PO_NUMBER
1202
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
1203
            this.poNumber = iprot.readString();
1204
          } else { 
1205
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1206
          }
1207
          break;
1208
        case 3: // LINEITEMS
1209
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
1210
            {
1211
              org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
1212
              this.lineitems = new ArrayList<LineItem>(_list0.size);
1213
              for (int _i1 = 0; _i1 < _list0.size; ++_i1)
1214
              {
1215
                LineItem _elem2; // required
1216
                _elem2 = new LineItem();
1217
                _elem2.read(iprot);
1218
                this.lineitems.add(_elem2);
1219
              }
1220
              iprot.readListEnd();
1221
            }
1222
          } else { 
1223
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1224
          }
1225
          break;
1226
        case 4: // SUPPLIER_ID
1227
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1228
            this.supplierId = iprot.readI64();
1229
            setSupplierIdIsSet(true);
1230
          } else { 
1231
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1232
          }
1233
          break;
1234
        case 5: // WAREHOUSE_ID
1235
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1236
            this.warehouseId = iprot.readI64();
1237
            setWarehouseIdIsSet(true);
1238
          } else { 
1239
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1240
          }
1241
          break;
1242
        case 6: // STATUS
1243
          if (field.type == org.apache.thrift.protocol.TType.I32) {
1244
            this.status = POStatus.findByValue(iprot.readI32());
1245
          } else { 
1246
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1247
          }
1248
          break;
1249
        case 7: // CREATED_AT
1250
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1251
            this.createdAt = iprot.readI64();
1252
            setCreatedAtIsSet(true);
1253
          } else { 
1254
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1255
          }
1256
          break;
1257
        case 8: // UPDATED_AT
1258
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1259
            this.updatedAt = iprot.readI64();
1260
            setUpdatedAtIsSet(true);
1261
          } else { 
1262
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1263
          }
1264
          break;
1265
        case 9: // TOTAL_COST
1266
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
1267
            this.totalCost = iprot.readDouble();
1268
            setTotalCostIsSet(true);
1269
          } else { 
1270
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1271
          }
1272
          break;
1273
        case 10: // FREIGHT_CHARGES
1274
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
1275
            this.freightCharges = iprot.readDouble();
1276
            setFreightChargesIsSet(true);
1277
          } else { 
1278
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1279
          }
1280
          break;
1281
        case 11: // REALIZED_COST
1282
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
1283
            this.realizedCost = iprot.readDouble();
1284
            setRealizedCostIsSet(true);
1285
          } else { 
1286
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1287
          }
1288
          break;
1289
        case 12: // REALIZED_FREIGHT_CHARGES
1290
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
1291
            this.realizedFreightCharges = iprot.readDouble();
1292
            setRealizedFreightChargesIsSet(true);
1293
          } else { 
1294
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1295
          }
1296
          break;
6821 amar.kumar 1297
        case 13: // TYPE
1298
          if (field.type == org.apache.thrift.protocol.TType.I32) {
1299
            this.type = POType.findByValue(iprot.readI32());
1300
          } else { 
1301
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1302
          }
1303
          break;
9416 amar.kumar 1304
        case 14: // TAX_TYPE
1305
          if (field.type == org.apache.thrift.protocol.TType.I32) {
1306
            this.taxType = TaxType.findByValue(iprot.readI32());
1307
          } else { 
1308
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1309
          }
1310
          break;
4496 mandeep.dh 1311
        default:
1312
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1313
      }
1314
      iprot.readFieldEnd();
1315
    }
1316
    iprot.readStructEnd();
1317
    validate();
1318
  }
1319
 
1320
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1321
    validate();
1322
 
1323
    oprot.writeStructBegin(STRUCT_DESC);
1324
    oprot.writeFieldBegin(ID_FIELD_DESC);
1325
    oprot.writeI64(this.id);
1326
    oprot.writeFieldEnd();
1327
    if (this.poNumber != null) {
1328
      oprot.writeFieldBegin(PO_NUMBER_FIELD_DESC);
1329
      oprot.writeString(this.poNumber);
1330
      oprot.writeFieldEnd();
1331
    }
1332
    if (this.lineitems != null) {
1333
      oprot.writeFieldBegin(LINEITEMS_FIELD_DESC);
1334
      {
1335
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.lineitems.size()));
1336
        for (LineItem _iter3 : this.lineitems)
1337
        {
1338
          _iter3.write(oprot);
1339
        }
1340
        oprot.writeListEnd();
1341
      }
1342
      oprot.writeFieldEnd();
1343
    }
1344
    oprot.writeFieldBegin(SUPPLIER_ID_FIELD_DESC);
1345
    oprot.writeI64(this.supplierId);
1346
    oprot.writeFieldEnd();
1347
    oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
1348
    oprot.writeI64(this.warehouseId);
1349
    oprot.writeFieldEnd();
1350
    if (this.status != null) {
1351
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
1352
      oprot.writeI32(this.status.getValue());
1353
      oprot.writeFieldEnd();
1354
    }
1355
    oprot.writeFieldBegin(CREATED_AT_FIELD_DESC);
1356
    oprot.writeI64(this.createdAt);
1357
    oprot.writeFieldEnd();
1358
    oprot.writeFieldBegin(UPDATED_AT_FIELD_DESC);
1359
    oprot.writeI64(this.updatedAt);
1360
    oprot.writeFieldEnd();
1361
    oprot.writeFieldBegin(TOTAL_COST_FIELD_DESC);
1362
    oprot.writeDouble(this.totalCost);
1363
    oprot.writeFieldEnd();
1364
    oprot.writeFieldBegin(FREIGHT_CHARGES_FIELD_DESC);
1365
    oprot.writeDouble(this.freightCharges);
1366
    oprot.writeFieldEnd();
1367
    oprot.writeFieldBegin(REALIZED_COST_FIELD_DESC);
1368
    oprot.writeDouble(this.realizedCost);
1369
    oprot.writeFieldEnd();
1370
    oprot.writeFieldBegin(REALIZED_FREIGHT_CHARGES_FIELD_DESC);
1371
    oprot.writeDouble(this.realizedFreightCharges);
1372
    oprot.writeFieldEnd();
6821 amar.kumar 1373
    if (this.type != null) {
1374
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
1375
      oprot.writeI32(this.type.getValue());
1376
      oprot.writeFieldEnd();
1377
    }
9416 amar.kumar 1378
    if (this.taxType != null) {
1379
      oprot.writeFieldBegin(TAX_TYPE_FIELD_DESC);
1380
      oprot.writeI32(this.taxType.getValue());
1381
      oprot.writeFieldEnd();
1382
    }
4496 mandeep.dh 1383
    oprot.writeFieldStop();
1384
    oprot.writeStructEnd();
1385
  }
1386
 
1387
  @Override
1388
  public String toString() {
1389
    StringBuilder sb = new StringBuilder("PurchaseOrder(");
1390
    boolean first = true;
1391
 
1392
    sb.append("id:");
1393
    sb.append(this.id);
1394
    first = false;
1395
    if (!first) sb.append(", ");
1396
    sb.append("poNumber:");
1397
    if (this.poNumber == null) {
1398
      sb.append("null");
1399
    } else {
1400
      sb.append(this.poNumber);
1401
    }
1402
    first = false;
1403
    if (!first) sb.append(", ");
1404
    sb.append("lineitems:");
1405
    if (this.lineitems == null) {
1406
      sb.append("null");
1407
    } else {
1408
      sb.append(this.lineitems);
1409
    }
1410
    first = false;
1411
    if (!first) sb.append(", ");
1412
    sb.append("supplierId:");
1413
    sb.append(this.supplierId);
1414
    first = false;
1415
    if (!first) sb.append(", ");
1416
    sb.append("warehouseId:");
1417
    sb.append(this.warehouseId);
1418
    first = false;
1419
    if (!first) sb.append(", ");
1420
    sb.append("status:");
1421
    if (this.status == null) {
1422
      sb.append("null");
1423
    } else {
1424
      sb.append(this.status);
1425
    }
1426
    first = false;
1427
    if (!first) sb.append(", ");
1428
    sb.append("createdAt:");
1429
    sb.append(this.createdAt);
1430
    first = false;
1431
    if (!first) sb.append(", ");
1432
    sb.append("updatedAt:");
1433
    sb.append(this.updatedAt);
1434
    first = false;
1435
    if (!first) sb.append(", ");
1436
    sb.append("totalCost:");
1437
    sb.append(this.totalCost);
1438
    first = false;
1439
    if (!first) sb.append(", ");
1440
    sb.append("freightCharges:");
1441
    sb.append(this.freightCharges);
1442
    first = false;
1443
    if (!first) sb.append(", ");
1444
    sb.append("realizedCost:");
1445
    sb.append(this.realizedCost);
1446
    first = false;
1447
    if (!first) sb.append(", ");
1448
    sb.append("realizedFreightCharges:");
1449
    sb.append(this.realizedFreightCharges);
1450
    first = false;
6821 amar.kumar 1451
    if (!first) sb.append(", ");
1452
    sb.append("type:");
1453
    if (this.type == null) {
1454
      sb.append("null");
1455
    } else {
1456
      sb.append(this.type);
1457
    }
1458
    first = false;
9416 amar.kumar 1459
    if (!first) sb.append(", ");
1460
    sb.append("taxType:");
1461
    if (this.taxType == null) {
1462
      sb.append("null");
1463
    } else {
1464
      sb.append(this.taxType);
1465
    }
1466
    first = false;
4496 mandeep.dh 1467
    sb.append(")");
1468
    return sb.toString();
1469
  }
1470
 
1471
  public void validate() throws org.apache.thrift.TException {
1472
    // check for required fields
1473
  }
1474
 
1475
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1476
    try {
1477
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1478
    } catch (org.apache.thrift.TException te) {
1479
      throw new java.io.IOException(te);
1480
    }
1481
  }
1482
 
1483
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1484
    try {
1485
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1486
      __isset_bit_vector = new BitSet(1);
1487
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1488
    } catch (org.apache.thrift.TException te) {
1489
      throw new java.io.IOException(te);
1490
    }
1491
  }
1492
 
1493
}
1494