Subversion Repositories SmartDukaan

Rev

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