Subversion Repositories SmartDukaan

Rev

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