Subversion Repositories SmartDukaan

Rev

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