Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2820 chandransh 1
/**
2
 * Autogenerated by Thrift
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.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class StockLedger implements TBase<StockLedger._Fields>, java.io.Serializable, Cloneable, Comparable<StockLedger> {
27
  private static final TStruct STRUCT_DESC = new TStruct("StockLedger");
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
30
  private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)2);
31
  private static final TField WAREHOUSE_ID_FIELD_DESC = new TField("warehouseId", TType.I64, (short)3);
32
  private static final TField PURCHASE_ID_FIELD_DESC = new TField("purchaseId", TType.I64, (short)4);
33
  private static final TField ITEM_NUMBER_FIELD_DESC = new TField("itemNumber", TType.STRING, (short)5);
34
  private static final TField IMEI_NUMBER_FIELD_DESC = new TField("imeiNumber", TType.STRING, (short)6);
35
  private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)7);
36
 
37
  private long id;
38
  private long itemId;
39
  private long warehouseId;
40
  private long purchaseId;
41
  private String itemNumber;
42
  private String imeiNumber;
43
  private StockLedgerStatus status;
44
 
45
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
46
  public enum _Fields implements TFieldIdEnum {
47
    ID((short)1, "id"),
48
    ITEM_ID((short)2, "itemId"),
49
    WAREHOUSE_ID((short)3, "warehouseId"),
50
    PURCHASE_ID((short)4, "purchaseId"),
51
    ITEM_NUMBER((short)5, "itemNumber"),
52
    IMEI_NUMBER((short)6, "imeiNumber"),
53
    /**
54
     * 
55
     * @see StockLedgerStatus
56
     */
57
    STATUS((short)7, "status");
58
 
59
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
60
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
61
 
62
    static {
63
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
64
        byId.put((int)field._thriftId, field);
65
        byName.put(field.getFieldName(), field);
66
      }
67
    }
68
 
69
    /**
70
     * Find the _Fields constant that matches fieldId, or null if its not found.
71
     */
72
    public static _Fields findByThriftId(int fieldId) {
73
      return byId.get(fieldId);
74
    }
75
 
76
    /**
77
     * Find the _Fields constant that matches fieldId, throwing an exception
78
     * if it is not found.
79
     */
80
    public static _Fields findByThriftIdOrThrow(int fieldId) {
81
      _Fields fields = findByThriftId(fieldId);
82
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
83
      return fields;
84
    }
85
 
86
    /**
87
     * Find the _Fields constant that matches name, or null if its not found.
88
     */
89
    public static _Fields findByName(String name) {
90
      return byName.get(name);
91
    }
92
 
93
    private final short _thriftId;
94
    private final String _fieldName;
95
 
96
    _Fields(short thriftId, String fieldName) {
97
      _thriftId = thriftId;
98
      _fieldName = fieldName;
99
    }
100
 
101
    public short getThriftFieldId() {
102
      return _thriftId;
103
    }
104
 
105
    public String getFieldName() {
106
      return _fieldName;
107
    }
108
  }
109
 
110
  // isset id assignments
111
  private static final int __ID_ISSET_ID = 0;
112
  private static final int __ITEMID_ISSET_ID = 1;
113
  private static final int __WAREHOUSEID_ISSET_ID = 2;
114
  private static final int __PURCHASEID_ISSET_ID = 3;
115
  private BitSet __isset_bit_vector = new BitSet(4);
116
 
117
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
118
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
119
        new FieldValueMetaData(TType.I64)));
120
    put(_Fields.ITEM_ID, new FieldMetaData("itemId", TFieldRequirementType.DEFAULT, 
121
        new FieldValueMetaData(TType.I64)));
122
    put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouseId", TFieldRequirementType.DEFAULT, 
123
        new FieldValueMetaData(TType.I64)));
124
    put(_Fields.PURCHASE_ID, new FieldMetaData("purchaseId", TFieldRequirementType.DEFAULT, 
125
        new FieldValueMetaData(TType.I64)));
126
    put(_Fields.ITEM_NUMBER, new FieldMetaData("itemNumber", TFieldRequirementType.DEFAULT, 
127
        new FieldValueMetaData(TType.STRING)));
128
    put(_Fields.IMEI_NUMBER, new FieldMetaData("imeiNumber", TFieldRequirementType.DEFAULT, 
129
        new FieldValueMetaData(TType.STRING)));
130
    put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
131
        new EnumMetaData(TType.ENUM, StockLedgerStatus.class)));
132
  }});
133
 
134
  static {
135
    FieldMetaData.addStructMetaDataMap(StockLedger.class, metaDataMap);
136
  }
137
 
138
  public StockLedger() {
139
  }
140
 
141
  public StockLedger(
142
    long id,
143
    long itemId,
144
    long warehouseId,
145
    long purchaseId,
146
    String itemNumber,
147
    String imeiNumber,
148
    StockLedgerStatus status)
149
  {
150
    this();
151
    this.id = id;
152
    setIdIsSet(true);
153
    this.itemId = itemId;
154
    setItemIdIsSet(true);
155
    this.warehouseId = warehouseId;
156
    setWarehouseIdIsSet(true);
157
    this.purchaseId = purchaseId;
158
    setPurchaseIdIsSet(true);
159
    this.itemNumber = itemNumber;
160
    this.imeiNumber = imeiNumber;
161
    this.status = status;
162
  }
163
 
164
  /**
165
   * Performs a deep copy on <i>other</i>.
166
   */
167
  public StockLedger(StockLedger other) {
168
    __isset_bit_vector.clear();
169
    __isset_bit_vector.or(other.__isset_bit_vector);
170
    this.id = other.id;
171
    this.itemId = other.itemId;
172
    this.warehouseId = other.warehouseId;
173
    this.purchaseId = other.purchaseId;
174
    if (other.isSetItemNumber()) {
175
      this.itemNumber = other.itemNumber;
176
    }
177
    if (other.isSetImeiNumber()) {
178
      this.imeiNumber = other.imeiNumber;
179
    }
180
    if (other.isSetStatus()) {
181
      this.status = other.status;
182
    }
183
  }
184
 
185
  public StockLedger deepCopy() {
186
    return new StockLedger(this);
187
  }
188
 
189
  @Deprecated
190
  public StockLedger clone() {
191
    return new StockLedger(this);
192
  }
193
 
194
  public long getId() {
195
    return this.id;
196
  }
197
 
198
  public StockLedger setId(long id) {
199
    this.id = id;
200
    setIdIsSet(true);
201
    return this;
202
  }
203
 
204
  public void unsetId() {
205
    __isset_bit_vector.clear(__ID_ISSET_ID);
206
  }
207
 
208
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
209
  public boolean isSetId() {
210
    return __isset_bit_vector.get(__ID_ISSET_ID);
211
  }
212
 
213
  public void setIdIsSet(boolean value) {
214
    __isset_bit_vector.set(__ID_ISSET_ID, value);
215
  }
216
 
217
  public long getItemId() {
218
    return this.itemId;
219
  }
220
 
221
  public StockLedger setItemId(long itemId) {
222
    this.itemId = itemId;
223
    setItemIdIsSet(true);
224
    return this;
225
  }
226
 
227
  public void unsetItemId() {
228
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
229
  }
230
 
231
  /** Returns true if field itemId is set (has been asigned a value) and false otherwise */
232
  public boolean isSetItemId() {
233
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
234
  }
235
 
236
  public void setItemIdIsSet(boolean value) {
237
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
238
  }
239
 
240
  public long getWarehouseId() {
241
    return this.warehouseId;
242
  }
243
 
244
  public StockLedger setWarehouseId(long warehouseId) {
245
    this.warehouseId = warehouseId;
246
    setWarehouseIdIsSet(true);
247
    return this;
248
  }
249
 
250
  public void unsetWarehouseId() {
251
    __isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
252
  }
253
 
254
  /** Returns true if field warehouseId is set (has been asigned a value) and false otherwise */
255
  public boolean isSetWarehouseId() {
256
    return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
257
  }
258
 
259
  public void setWarehouseIdIsSet(boolean value) {
260
    __isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
261
  }
262
 
263
  public long getPurchaseId() {
264
    return this.purchaseId;
265
  }
266
 
267
  public StockLedger setPurchaseId(long purchaseId) {
268
    this.purchaseId = purchaseId;
269
    setPurchaseIdIsSet(true);
270
    return this;
271
  }
272
 
273
  public void unsetPurchaseId() {
274
    __isset_bit_vector.clear(__PURCHASEID_ISSET_ID);
275
  }
276
 
277
  /** Returns true if field purchaseId is set (has been asigned a value) and false otherwise */
278
  public boolean isSetPurchaseId() {
279
    return __isset_bit_vector.get(__PURCHASEID_ISSET_ID);
280
  }
281
 
282
  public void setPurchaseIdIsSet(boolean value) {
283
    __isset_bit_vector.set(__PURCHASEID_ISSET_ID, value);
284
  }
285
 
286
  public String getItemNumber() {
287
    return this.itemNumber;
288
  }
289
 
290
  public StockLedger setItemNumber(String itemNumber) {
291
    this.itemNumber = itemNumber;
292
    return this;
293
  }
294
 
295
  public void unsetItemNumber() {
296
    this.itemNumber = null;
297
  }
298
 
299
  /** Returns true if field itemNumber is set (has been asigned a value) and false otherwise */
300
  public boolean isSetItemNumber() {
301
    return this.itemNumber != null;
302
  }
303
 
304
  public void setItemNumberIsSet(boolean value) {
305
    if (!value) {
306
      this.itemNumber = null;
307
    }
308
  }
309
 
310
  public String getImeiNumber() {
311
    return this.imeiNumber;
312
  }
313
 
314
  public StockLedger setImeiNumber(String imeiNumber) {
315
    this.imeiNumber = imeiNumber;
316
    return this;
317
  }
318
 
319
  public void unsetImeiNumber() {
320
    this.imeiNumber = null;
321
  }
322
 
323
  /** Returns true if field imeiNumber is set (has been asigned a value) and false otherwise */
324
  public boolean isSetImeiNumber() {
325
    return this.imeiNumber != null;
326
  }
327
 
328
  public void setImeiNumberIsSet(boolean value) {
329
    if (!value) {
330
      this.imeiNumber = null;
331
    }
332
  }
333
 
334
  /**
335
   * 
336
   * @see StockLedgerStatus
337
   */
338
  public StockLedgerStatus getStatus() {
339
    return this.status;
340
  }
341
 
342
  /**
343
   * 
344
   * @see StockLedgerStatus
345
   */
346
  public StockLedger setStatus(StockLedgerStatus status) {
347
    this.status = status;
348
    return this;
349
  }
350
 
351
  public void unsetStatus() {
352
    this.status = null;
353
  }
354
 
355
  /** Returns true if field status is set (has been asigned a value) and false otherwise */
356
  public boolean isSetStatus() {
357
    return this.status != null;
358
  }
359
 
360
  public void setStatusIsSet(boolean value) {
361
    if (!value) {
362
      this.status = null;
363
    }
364
  }
365
 
366
  public void setFieldValue(_Fields field, Object value) {
367
    switch (field) {
368
    case ID:
369
      if (value == null) {
370
        unsetId();
371
      } else {
372
        setId((Long)value);
373
      }
374
      break;
375
 
376
    case ITEM_ID:
377
      if (value == null) {
378
        unsetItemId();
379
      } else {
380
        setItemId((Long)value);
381
      }
382
      break;
383
 
384
    case WAREHOUSE_ID:
385
      if (value == null) {
386
        unsetWarehouseId();
387
      } else {
388
        setWarehouseId((Long)value);
389
      }
390
      break;
391
 
392
    case PURCHASE_ID:
393
      if (value == null) {
394
        unsetPurchaseId();
395
      } else {
396
        setPurchaseId((Long)value);
397
      }
398
      break;
399
 
400
    case ITEM_NUMBER:
401
      if (value == null) {
402
        unsetItemNumber();
403
      } else {
404
        setItemNumber((String)value);
405
      }
406
      break;
407
 
408
    case IMEI_NUMBER:
409
      if (value == null) {
410
        unsetImeiNumber();
411
      } else {
412
        setImeiNumber((String)value);
413
      }
414
      break;
415
 
416
    case STATUS:
417
      if (value == null) {
418
        unsetStatus();
419
      } else {
420
        setStatus((StockLedgerStatus)value);
421
      }
422
      break;
423
 
424
    }
425
  }
426
 
427
  public void setFieldValue(int fieldID, Object value) {
428
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
429
  }
430
 
431
  public Object getFieldValue(_Fields field) {
432
    switch (field) {
433
    case ID:
434
      return new Long(getId());
435
 
436
    case ITEM_ID:
437
      return new Long(getItemId());
438
 
439
    case WAREHOUSE_ID:
440
      return new Long(getWarehouseId());
441
 
442
    case PURCHASE_ID:
443
      return new Long(getPurchaseId());
444
 
445
    case ITEM_NUMBER:
446
      return getItemNumber();
447
 
448
    case IMEI_NUMBER:
449
      return getImeiNumber();
450
 
451
    case STATUS:
452
      return getStatus();
453
 
454
    }
455
    throw new IllegalStateException();
456
  }
457
 
458
  public Object getFieldValue(int fieldId) {
459
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
460
  }
461
 
462
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
463
  public boolean isSet(_Fields field) {
464
    switch (field) {
465
    case ID:
466
      return isSetId();
467
    case ITEM_ID:
468
      return isSetItemId();
469
    case WAREHOUSE_ID:
470
      return isSetWarehouseId();
471
    case PURCHASE_ID:
472
      return isSetPurchaseId();
473
    case ITEM_NUMBER:
474
      return isSetItemNumber();
475
    case IMEI_NUMBER:
476
      return isSetImeiNumber();
477
    case STATUS:
478
      return isSetStatus();
479
    }
480
    throw new IllegalStateException();
481
  }
482
 
483
  public boolean isSet(int fieldID) {
484
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
485
  }
486
 
487
  @Override
488
  public boolean equals(Object that) {
489
    if (that == null)
490
      return false;
491
    if (that instanceof StockLedger)
492
      return this.equals((StockLedger)that);
493
    return false;
494
  }
495
 
496
  public boolean equals(StockLedger that) {
497
    if (that == null)
498
      return false;
499
 
500
    boolean this_present_id = true;
501
    boolean that_present_id = true;
502
    if (this_present_id || that_present_id) {
503
      if (!(this_present_id && that_present_id))
504
        return false;
505
      if (this.id != that.id)
506
        return false;
507
    }
508
 
509
    boolean this_present_itemId = true;
510
    boolean that_present_itemId = true;
511
    if (this_present_itemId || that_present_itemId) {
512
      if (!(this_present_itemId && that_present_itemId))
513
        return false;
514
      if (this.itemId != that.itemId)
515
        return false;
516
    }
517
 
518
    boolean this_present_warehouseId = true;
519
    boolean that_present_warehouseId = true;
520
    if (this_present_warehouseId || that_present_warehouseId) {
521
      if (!(this_present_warehouseId && that_present_warehouseId))
522
        return false;
523
      if (this.warehouseId != that.warehouseId)
524
        return false;
525
    }
526
 
527
    boolean this_present_purchaseId = true;
528
    boolean that_present_purchaseId = true;
529
    if (this_present_purchaseId || that_present_purchaseId) {
530
      if (!(this_present_purchaseId && that_present_purchaseId))
531
        return false;
532
      if (this.purchaseId != that.purchaseId)
533
        return false;
534
    }
535
 
536
    boolean this_present_itemNumber = true && this.isSetItemNumber();
537
    boolean that_present_itemNumber = true && that.isSetItemNumber();
538
    if (this_present_itemNumber || that_present_itemNumber) {
539
      if (!(this_present_itemNumber && that_present_itemNumber))
540
        return false;
541
      if (!this.itemNumber.equals(that.itemNumber))
542
        return false;
543
    }
544
 
545
    boolean this_present_imeiNumber = true && this.isSetImeiNumber();
546
    boolean that_present_imeiNumber = true && that.isSetImeiNumber();
547
    if (this_present_imeiNumber || that_present_imeiNumber) {
548
      if (!(this_present_imeiNumber && that_present_imeiNumber))
549
        return false;
550
      if (!this.imeiNumber.equals(that.imeiNumber))
551
        return false;
552
    }
553
 
554
    boolean this_present_status = true && this.isSetStatus();
555
    boolean that_present_status = true && that.isSetStatus();
556
    if (this_present_status || that_present_status) {
557
      if (!(this_present_status && that_present_status))
558
        return false;
559
      if (!this.status.equals(that.status))
560
        return false;
561
    }
562
 
563
    return true;
564
  }
565
 
566
  @Override
567
  public int hashCode() {
568
    return 0;
569
  }
570
 
571
  public int compareTo(StockLedger other) {
572
    if (!getClass().equals(other.getClass())) {
573
      return getClass().getName().compareTo(other.getClass().getName());
574
    }
575
 
576
    int lastComparison = 0;
577
    StockLedger typedOther = (StockLedger)other;
578
 
579
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
580
    if (lastComparison != 0) {
581
      return lastComparison;
582
    }
583
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
584
    if (lastComparison != 0) {
585
      return lastComparison;
586
    }
587
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(isSetItemId());
588
    if (lastComparison != 0) {
589
      return lastComparison;
590
    }
591
    lastComparison = TBaseHelper.compareTo(itemId, typedOther.itemId);
592
    if (lastComparison != 0) {
593
      return lastComparison;
594
    }
595
    lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(isSetWarehouseId());
596
    if (lastComparison != 0) {
597
      return lastComparison;
598
    }
599
    lastComparison = TBaseHelper.compareTo(warehouseId, typedOther.warehouseId);
600
    if (lastComparison != 0) {
601
      return lastComparison;
602
    }
603
    lastComparison = Boolean.valueOf(isSetPurchaseId()).compareTo(isSetPurchaseId());
604
    if (lastComparison != 0) {
605
      return lastComparison;
606
    }
607
    lastComparison = TBaseHelper.compareTo(purchaseId, typedOther.purchaseId);
608
    if (lastComparison != 0) {
609
      return lastComparison;
610
    }
611
    lastComparison = Boolean.valueOf(isSetItemNumber()).compareTo(isSetItemNumber());
612
    if (lastComparison != 0) {
613
      return lastComparison;
614
    }
615
    lastComparison = TBaseHelper.compareTo(itemNumber, typedOther.itemNumber);
616
    if (lastComparison != 0) {
617
      return lastComparison;
618
    }
619
    lastComparison = Boolean.valueOf(isSetImeiNumber()).compareTo(isSetImeiNumber());
620
    if (lastComparison != 0) {
621
      return lastComparison;
622
    }
623
    lastComparison = TBaseHelper.compareTo(imeiNumber, typedOther.imeiNumber);
624
    if (lastComparison != 0) {
625
      return lastComparison;
626
    }
627
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
628
    if (lastComparison != 0) {
629
      return lastComparison;
630
    }
631
    lastComparison = TBaseHelper.compareTo(status, typedOther.status);
632
    if (lastComparison != 0) {
633
      return lastComparison;
634
    }
635
    return 0;
636
  }
637
 
638
  public void read(TProtocol iprot) throws TException {
639
    TField field;
640
    iprot.readStructBegin();
641
    while (true)
642
    {
643
      field = iprot.readFieldBegin();
644
      if (field.type == TType.STOP) { 
645
        break;
646
      }
647
      _Fields fieldId = _Fields.findByThriftId(field.id);
648
      if (fieldId == null) {
649
        TProtocolUtil.skip(iprot, field.type);
650
      } else {
651
        switch (fieldId) {
652
          case ID:
653
            if (field.type == TType.I64) {
654
              this.id = iprot.readI64();
655
              setIdIsSet(true);
656
            } else { 
657
              TProtocolUtil.skip(iprot, field.type);
658
            }
659
            break;
660
          case ITEM_ID:
661
            if (field.type == TType.I64) {
662
              this.itemId = iprot.readI64();
663
              setItemIdIsSet(true);
664
            } else { 
665
              TProtocolUtil.skip(iprot, field.type);
666
            }
667
            break;
668
          case WAREHOUSE_ID:
669
            if (field.type == TType.I64) {
670
              this.warehouseId = iprot.readI64();
671
              setWarehouseIdIsSet(true);
672
            } else { 
673
              TProtocolUtil.skip(iprot, field.type);
674
            }
675
            break;
676
          case PURCHASE_ID:
677
            if (field.type == TType.I64) {
678
              this.purchaseId = iprot.readI64();
679
              setPurchaseIdIsSet(true);
680
            } else { 
681
              TProtocolUtil.skip(iprot, field.type);
682
            }
683
            break;
684
          case ITEM_NUMBER:
685
            if (field.type == TType.STRING) {
686
              this.itemNumber = iprot.readString();
687
            } else { 
688
              TProtocolUtil.skip(iprot, field.type);
689
            }
690
            break;
691
          case IMEI_NUMBER:
692
            if (field.type == TType.STRING) {
693
              this.imeiNumber = iprot.readString();
694
            } else { 
695
              TProtocolUtil.skip(iprot, field.type);
696
            }
697
            break;
698
          case STATUS:
699
            if (field.type == TType.I32) {
700
              this.status = StockLedgerStatus.findByValue(iprot.readI32());
701
            } else { 
702
              TProtocolUtil.skip(iprot, field.type);
703
            }
704
            break;
705
        }
706
        iprot.readFieldEnd();
707
      }
708
    }
709
    iprot.readStructEnd();
710
    validate();
711
  }
712
 
713
  public void write(TProtocol oprot) throws TException {
714
    validate();
715
 
716
    oprot.writeStructBegin(STRUCT_DESC);
717
    oprot.writeFieldBegin(ID_FIELD_DESC);
718
    oprot.writeI64(this.id);
719
    oprot.writeFieldEnd();
720
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
721
    oprot.writeI64(this.itemId);
722
    oprot.writeFieldEnd();
723
    oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
724
    oprot.writeI64(this.warehouseId);
725
    oprot.writeFieldEnd();
726
    oprot.writeFieldBegin(PURCHASE_ID_FIELD_DESC);
727
    oprot.writeI64(this.purchaseId);
728
    oprot.writeFieldEnd();
729
    if (this.itemNumber != null) {
730
      oprot.writeFieldBegin(ITEM_NUMBER_FIELD_DESC);
731
      oprot.writeString(this.itemNumber);
732
      oprot.writeFieldEnd();
733
    }
734
    if (this.imeiNumber != null) {
735
      oprot.writeFieldBegin(IMEI_NUMBER_FIELD_DESC);
736
      oprot.writeString(this.imeiNumber);
737
      oprot.writeFieldEnd();
738
    }
739
    if (this.status != null) {
740
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
741
      oprot.writeI32(this.status.getValue());
742
      oprot.writeFieldEnd();
743
    }
744
    oprot.writeFieldStop();
745
    oprot.writeStructEnd();
746
  }
747
 
748
  @Override
749
  public String toString() {
750
    StringBuilder sb = new StringBuilder("StockLedger(");
751
    boolean first = true;
752
 
753
    sb.append("id:");
754
    sb.append(this.id);
755
    first = false;
756
    if (!first) sb.append(", ");
757
    sb.append("itemId:");
758
    sb.append(this.itemId);
759
    first = false;
760
    if (!first) sb.append(", ");
761
    sb.append("warehouseId:");
762
    sb.append(this.warehouseId);
763
    first = false;
764
    if (!first) sb.append(", ");
765
    sb.append("purchaseId:");
766
    sb.append(this.purchaseId);
767
    first = false;
768
    if (!first) sb.append(", ");
769
    sb.append("itemNumber:");
770
    if (this.itemNumber == null) {
771
      sb.append("null");
772
    } else {
773
      sb.append(this.itemNumber);
774
    }
775
    first = false;
776
    if (!first) sb.append(", ");
777
    sb.append("imeiNumber:");
778
    if (this.imeiNumber == null) {
779
      sb.append("null");
780
    } else {
781
      sb.append(this.imeiNumber);
782
    }
783
    first = false;
784
    if (!first) sb.append(", ");
785
    sb.append("status:");
786
    if (this.status == null) {
787
      sb.append("null");
788
    } else {
789
      String status_name = status.name();
790
      if (status_name != null) {
791
        sb.append(status_name);
792
        sb.append(" (");
793
      }
794
      sb.append(this.status);
795
      if (status_name != null) {
796
        sb.append(")");
797
      }
798
    }
799
    first = false;
800
    sb.append(")");
801
    return sb.toString();
802
  }
803
 
804
  public void validate() throws TException {
805
    // check for required fields
806
  }
807
 
808
}
809