Subversion Repositories SmartDukaan

Rev

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