Subversion Repositories SmartDukaan

Rev

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