Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12357 manish.sha 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.model.v1.inventory;
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 StockWeightedNlcInfo implements org.apache.thrift.TBase<StockWeightedNlcInfo, StockWeightedNlcInfo._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StockWeightedNlcInfo");
25
 
26
  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)1);
27
  private static final org.apache.thrift.protocol.TField SOURCE_FIELD_DESC = new org.apache.thrift.protocol.TField("source", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField UPDATED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("updatedTimestamp", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField STOCK_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("stockQuantity", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField GRN_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("grnDetail", org.apache.thrift.protocol.TType.STRING, (short)5);
31
  private static final org.apache.thrift.protocol.TField AVG_WEIGHTED_NLC_FIELD_DESC = new org.apache.thrift.protocol.TField("avgWeightedNlc", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
32
 
33
  private long itemId; // required
34
  private long source; // required
35
  private long updatedTimestamp; // required
36
  private long stockQuantity; // required
37
  private String grnDetail; // required
38
  private double avgWeightedNlc; // required
39
 
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
42
    ITEM_ID((short)1, "itemId"),
43
    SOURCE((short)2, "source"),
44
    UPDATED_TIMESTAMP((short)3, "updatedTimestamp"),
45
    STOCK_QUANTITY((short)4, "stockQuantity"),
46
    GRN_DETAIL((short)5, "grnDetail"),
47
    AVG_WEIGHTED_NLC((short)6, "avgWeightedNlc");
48
 
49
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
50
 
51
    static {
52
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
53
        byName.put(field.getFieldName(), field);
54
      }
55
    }
56
 
57
    /**
58
     * Find the _Fields constant that matches fieldId, or null if its not found.
59
     */
60
    public static _Fields findByThriftId(int fieldId) {
61
      switch(fieldId) {
62
        case 1: // ITEM_ID
63
          return ITEM_ID;
64
        case 2: // SOURCE
65
          return SOURCE;
66
        case 3: // UPDATED_TIMESTAMP
67
          return UPDATED_TIMESTAMP;
68
        case 4: // STOCK_QUANTITY
69
          return STOCK_QUANTITY;
70
        case 5: // GRN_DETAIL
71
          return GRN_DETAIL;
72
        case 6: // AVG_WEIGHTED_NLC
73
          return AVG_WEIGHTED_NLC;
74
        default:
75
          return null;
76
      }
77
    }
78
 
79
    /**
80
     * Find the _Fields constant that matches fieldId, throwing an exception
81
     * if it is not found.
82
     */
83
    public static _Fields findByThriftIdOrThrow(int fieldId) {
84
      _Fields fields = findByThriftId(fieldId);
85
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
86
      return fields;
87
    }
88
 
89
    /**
90
     * Find the _Fields constant that matches name, or null if its not found.
91
     */
92
    public static _Fields findByName(String name) {
93
      return byName.get(name);
94
    }
95
 
96
    private final short _thriftId;
97
    private final String _fieldName;
98
 
99
    _Fields(short thriftId, String fieldName) {
100
      _thriftId = thriftId;
101
      _fieldName = fieldName;
102
    }
103
 
104
    public short getThriftFieldId() {
105
      return _thriftId;
106
    }
107
 
108
    public String getFieldName() {
109
      return _fieldName;
110
    }
111
  }
112
 
113
  // isset id assignments
114
  private static final int __ITEMID_ISSET_ID = 0;
115
  private static final int __SOURCE_ISSET_ID = 1;
116
  private static final int __UPDATEDTIMESTAMP_ISSET_ID = 2;
117
  private static final int __STOCKQUANTITY_ISSET_ID = 3;
118
  private static final int __AVGWEIGHTEDNLC_ISSET_ID = 4;
119
  private BitSet __isset_bit_vector = new BitSet(5);
120
 
121
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
122
  static {
123
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
124
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
125
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
126
    tmpMap.put(_Fields.SOURCE, new org.apache.thrift.meta_data.FieldMetaData("source", org.apache.thrift.TFieldRequirementType.DEFAULT, 
127
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
128
    tmpMap.put(_Fields.UPDATED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("updatedTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
129
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
130
    tmpMap.put(_Fields.STOCK_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("stockQuantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
132
    tmpMap.put(_Fields.GRN_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("grnDetail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
134
    tmpMap.put(_Fields.AVG_WEIGHTED_NLC, new org.apache.thrift.meta_data.FieldMetaData("avgWeightedNlc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
136
    metaDataMap = Collections.unmodifiableMap(tmpMap);
137
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StockWeightedNlcInfo.class, metaDataMap);
138
  }
139
 
140
  public StockWeightedNlcInfo() {
141
  }
142
 
143
  public StockWeightedNlcInfo(
144
    long itemId,
145
    long source,
146
    long updatedTimestamp,
147
    long stockQuantity,
148
    String grnDetail,
149
    double avgWeightedNlc)
150
  {
151
    this();
152
    this.itemId = itemId;
153
    setItemIdIsSet(true);
154
    this.source = source;
155
    setSourceIsSet(true);
156
    this.updatedTimestamp = updatedTimestamp;
157
    setUpdatedTimestampIsSet(true);
158
    this.stockQuantity = stockQuantity;
159
    setStockQuantityIsSet(true);
160
    this.grnDetail = grnDetail;
161
    this.avgWeightedNlc = avgWeightedNlc;
162
    setAvgWeightedNlcIsSet(true);
163
  }
164
 
165
  /**
166
   * Performs a deep copy on <i>other</i>.
167
   */
168
  public StockWeightedNlcInfo(StockWeightedNlcInfo other) {
169
    __isset_bit_vector.clear();
170
    __isset_bit_vector.or(other.__isset_bit_vector);
171
    this.itemId = other.itemId;
172
    this.source = other.source;
173
    this.updatedTimestamp = other.updatedTimestamp;
174
    this.stockQuantity = other.stockQuantity;
175
    if (other.isSetGrnDetail()) {
176
      this.grnDetail = other.grnDetail;
177
    }
178
    this.avgWeightedNlc = other.avgWeightedNlc;
179
  }
180
 
181
  public StockWeightedNlcInfo deepCopy() {
182
    return new StockWeightedNlcInfo(this);
183
  }
184
 
185
  @Override
186
  public void clear() {
187
    setItemIdIsSet(false);
188
    this.itemId = 0;
189
    setSourceIsSet(false);
190
    this.source = 0;
191
    setUpdatedTimestampIsSet(false);
192
    this.updatedTimestamp = 0;
193
    setStockQuantityIsSet(false);
194
    this.stockQuantity = 0;
195
    this.grnDetail = null;
196
    setAvgWeightedNlcIsSet(false);
197
    this.avgWeightedNlc = 0.0;
198
  }
199
 
200
  public long getItemId() {
201
    return this.itemId;
202
  }
203
 
204
  public void setItemId(long itemId) {
205
    this.itemId = itemId;
206
    setItemIdIsSet(true);
207
  }
208
 
209
  public void unsetItemId() {
210
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
211
  }
212
 
213
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
214
  public boolean isSetItemId() {
215
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
216
  }
217
 
218
  public void setItemIdIsSet(boolean value) {
219
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
220
  }
221
 
222
  public long getSource() {
223
    return this.source;
224
  }
225
 
226
  public void setSource(long source) {
227
    this.source = source;
228
    setSourceIsSet(true);
229
  }
230
 
231
  public void unsetSource() {
232
    __isset_bit_vector.clear(__SOURCE_ISSET_ID);
233
  }
234
 
235
  /** Returns true if field source is set (has been assigned a value) and false otherwise */
236
  public boolean isSetSource() {
237
    return __isset_bit_vector.get(__SOURCE_ISSET_ID);
238
  }
239
 
240
  public void setSourceIsSet(boolean value) {
241
    __isset_bit_vector.set(__SOURCE_ISSET_ID, value);
242
  }
243
 
244
  public long getUpdatedTimestamp() {
245
    return this.updatedTimestamp;
246
  }
247
 
248
  public void setUpdatedTimestamp(long updatedTimestamp) {
249
    this.updatedTimestamp = updatedTimestamp;
250
    setUpdatedTimestampIsSet(true);
251
  }
252
 
253
  public void unsetUpdatedTimestamp() {
254
    __isset_bit_vector.clear(__UPDATEDTIMESTAMP_ISSET_ID);
255
  }
256
 
257
  /** Returns true if field updatedTimestamp is set (has been assigned a value) and false otherwise */
258
  public boolean isSetUpdatedTimestamp() {
259
    return __isset_bit_vector.get(__UPDATEDTIMESTAMP_ISSET_ID);
260
  }
261
 
262
  public void setUpdatedTimestampIsSet(boolean value) {
263
    __isset_bit_vector.set(__UPDATEDTIMESTAMP_ISSET_ID, value);
264
  }
265
 
266
  public long getStockQuantity() {
267
    return this.stockQuantity;
268
  }
269
 
270
  public void setStockQuantity(long stockQuantity) {
271
    this.stockQuantity = stockQuantity;
272
    setStockQuantityIsSet(true);
273
  }
274
 
275
  public void unsetStockQuantity() {
276
    __isset_bit_vector.clear(__STOCKQUANTITY_ISSET_ID);
277
  }
278
 
279
  /** Returns true if field stockQuantity is set (has been assigned a value) and false otherwise */
280
  public boolean isSetStockQuantity() {
281
    return __isset_bit_vector.get(__STOCKQUANTITY_ISSET_ID);
282
  }
283
 
284
  public void setStockQuantityIsSet(boolean value) {
285
    __isset_bit_vector.set(__STOCKQUANTITY_ISSET_ID, value);
286
  }
287
 
288
  public String getGrnDetail() {
289
    return this.grnDetail;
290
  }
291
 
292
  public void setGrnDetail(String grnDetail) {
293
    this.grnDetail = grnDetail;
294
  }
295
 
296
  public void unsetGrnDetail() {
297
    this.grnDetail = null;
298
  }
299
 
300
  /** Returns true if field grnDetail is set (has been assigned a value) and false otherwise */
301
  public boolean isSetGrnDetail() {
302
    return this.grnDetail != null;
303
  }
304
 
305
  public void setGrnDetailIsSet(boolean value) {
306
    if (!value) {
307
      this.grnDetail = null;
308
    }
309
  }
310
 
311
  public double getAvgWeightedNlc() {
312
    return this.avgWeightedNlc;
313
  }
314
 
315
  public void setAvgWeightedNlc(double avgWeightedNlc) {
316
    this.avgWeightedNlc = avgWeightedNlc;
317
    setAvgWeightedNlcIsSet(true);
318
  }
319
 
320
  public void unsetAvgWeightedNlc() {
321
    __isset_bit_vector.clear(__AVGWEIGHTEDNLC_ISSET_ID);
322
  }
323
 
324
  /** Returns true if field avgWeightedNlc is set (has been assigned a value) and false otherwise */
325
  public boolean isSetAvgWeightedNlc() {
326
    return __isset_bit_vector.get(__AVGWEIGHTEDNLC_ISSET_ID);
327
  }
328
 
329
  public void setAvgWeightedNlcIsSet(boolean value) {
330
    __isset_bit_vector.set(__AVGWEIGHTEDNLC_ISSET_ID, value);
331
  }
332
 
333
  public void setFieldValue(_Fields field, Object value) {
334
    switch (field) {
335
    case ITEM_ID:
336
      if (value == null) {
337
        unsetItemId();
338
      } else {
339
        setItemId((Long)value);
340
      }
341
      break;
342
 
343
    case SOURCE:
344
      if (value == null) {
345
        unsetSource();
346
      } else {
347
        setSource((Long)value);
348
      }
349
      break;
350
 
351
    case UPDATED_TIMESTAMP:
352
      if (value == null) {
353
        unsetUpdatedTimestamp();
354
      } else {
355
        setUpdatedTimestamp((Long)value);
356
      }
357
      break;
358
 
359
    case STOCK_QUANTITY:
360
      if (value == null) {
361
        unsetStockQuantity();
362
      } else {
363
        setStockQuantity((Long)value);
364
      }
365
      break;
366
 
367
    case GRN_DETAIL:
368
      if (value == null) {
369
        unsetGrnDetail();
370
      } else {
371
        setGrnDetail((String)value);
372
      }
373
      break;
374
 
375
    case AVG_WEIGHTED_NLC:
376
      if (value == null) {
377
        unsetAvgWeightedNlc();
378
      } else {
379
        setAvgWeightedNlc((Double)value);
380
      }
381
      break;
382
 
383
    }
384
  }
385
 
386
  public Object getFieldValue(_Fields field) {
387
    switch (field) {
388
    case ITEM_ID:
389
      return Long.valueOf(getItemId());
390
 
391
    case SOURCE:
392
      return Long.valueOf(getSource());
393
 
394
    case UPDATED_TIMESTAMP:
395
      return Long.valueOf(getUpdatedTimestamp());
396
 
397
    case STOCK_QUANTITY:
398
      return Long.valueOf(getStockQuantity());
399
 
400
    case GRN_DETAIL:
401
      return getGrnDetail();
402
 
403
    case AVG_WEIGHTED_NLC:
404
      return Double.valueOf(getAvgWeightedNlc());
405
 
406
    }
407
    throw new IllegalStateException();
408
  }
409
 
410
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
411
  public boolean isSet(_Fields field) {
412
    if (field == null) {
413
      throw new IllegalArgumentException();
414
    }
415
 
416
    switch (field) {
417
    case ITEM_ID:
418
      return isSetItemId();
419
    case SOURCE:
420
      return isSetSource();
421
    case UPDATED_TIMESTAMP:
422
      return isSetUpdatedTimestamp();
423
    case STOCK_QUANTITY:
424
      return isSetStockQuantity();
425
    case GRN_DETAIL:
426
      return isSetGrnDetail();
427
    case AVG_WEIGHTED_NLC:
428
      return isSetAvgWeightedNlc();
429
    }
430
    throw new IllegalStateException();
431
  }
432
 
433
  @Override
434
  public boolean equals(Object that) {
435
    if (that == null)
436
      return false;
437
    if (that instanceof StockWeightedNlcInfo)
438
      return this.equals((StockWeightedNlcInfo)that);
439
    return false;
440
  }
441
 
442
  public boolean equals(StockWeightedNlcInfo that) {
443
    if (that == null)
444
      return false;
445
 
446
    boolean this_present_itemId = true;
447
    boolean that_present_itemId = true;
448
    if (this_present_itemId || that_present_itemId) {
449
      if (!(this_present_itemId && that_present_itemId))
450
        return false;
451
      if (this.itemId != that.itemId)
452
        return false;
453
    }
454
 
455
    boolean this_present_source = true;
456
    boolean that_present_source = true;
457
    if (this_present_source || that_present_source) {
458
      if (!(this_present_source && that_present_source))
459
        return false;
460
      if (this.source != that.source)
461
        return false;
462
    }
463
 
464
    boolean this_present_updatedTimestamp = true;
465
    boolean that_present_updatedTimestamp = true;
466
    if (this_present_updatedTimestamp || that_present_updatedTimestamp) {
467
      if (!(this_present_updatedTimestamp && that_present_updatedTimestamp))
468
        return false;
469
      if (this.updatedTimestamp != that.updatedTimestamp)
470
        return false;
471
    }
472
 
473
    boolean this_present_stockQuantity = true;
474
    boolean that_present_stockQuantity = true;
475
    if (this_present_stockQuantity || that_present_stockQuantity) {
476
      if (!(this_present_stockQuantity && that_present_stockQuantity))
477
        return false;
478
      if (this.stockQuantity != that.stockQuantity)
479
        return false;
480
    }
481
 
482
    boolean this_present_grnDetail = true && this.isSetGrnDetail();
483
    boolean that_present_grnDetail = true && that.isSetGrnDetail();
484
    if (this_present_grnDetail || that_present_grnDetail) {
485
      if (!(this_present_grnDetail && that_present_grnDetail))
486
        return false;
487
      if (!this.grnDetail.equals(that.grnDetail))
488
        return false;
489
    }
490
 
491
    boolean this_present_avgWeightedNlc = true;
492
    boolean that_present_avgWeightedNlc = true;
493
    if (this_present_avgWeightedNlc || that_present_avgWeightedNlc) {
494
      if (!(this_present_avgWeightedNlc && that_present_avgWeightedNlc))
495
        return false;
496
      if (this.avgWeightedNlc != that.avgWeightedNlc)
497
        return false;
498
    }
499
 
500
    return true;
501
  }
502
 
503
  @Override
504
  public int hashCode() {
505
    return 0;
506
  }
507
 
508
  public int compareTo(StockWeightedNlcInfo other) {
509
    if (!getClass().equals(other.getClass())) {
510
      return getClass().getName().compareTo(other.getClass().getName());
511
    }
512
 
513
    int lastComparison = 0;
514
    StockWeightedNlcInfo typedOther = (StockWeightedNlcInfo)other;
515
 
516
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
517
    if (lastComparison != 0) {
518
      return lastComparison;
519
    }
520
    if (isSetItemId()) {
521
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
522
      if (lastComparison != 0) {
523
        return lastComparison;
524
      }
525
    }
526
    lastComparison = Boolean.valueOf(isSetSource()).compareTo(typedOther.isSetSource());
527
    if (lastComparison != 0) {
528
      return lastComparison;
529
    }
530
    if (isSetSource()) {
531
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source, typedOther.source);
532
      if (lastComparison != 0) {
533
        return lastComparison;
534
      }
535
    }
536
    lastComparison = Boolean.valueOf(isSetUpdatedTimestamp()).compareTo(typedOther.isSetUpdatedTimestamp());
537
    if (lastComparison != 0) {
538
      return lastComparison;
539
    }
540
    if (isSetUpdatedTimestamp()) {
541
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedTimestamp, typedOther.updatedTimestamp);
542
      if (lastComparison != 0) {
543
        return lastComparison;
544
      }
545
    }
546
    lastComparison = Boolean.valueOf(isSetStockQuantity()).compareTo(typedOther.isSetStockQuantity());
547
    if (lastComparison != 0) {
548
      return lastComparison;
549
    }
550
    if (isSetStockQuantity()) {
551
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stockQuantity, typedOther.stockQuantity);
552
      if (lastComparison != 0) {
553
        return lastComparison;
554
      }
555
    }
556
    lastComparison = Boolean.valueOf(isSetGrnDetail()).compareTo(typedOther.isSetGrnDetail());
557
    if (lastComparison != 0) {
558
      return lastComparison;
559
    }
560
    if (isSetGrnDetail()) {
561
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.grnDetail, typedOther.grnDetail);
562
      if (lastComparison != 0) {
563
        return lastComparison;
564
      }
565
    }
566
    lastComparison = Boolean.valueOf(isSetAvgWeightedNlc()).compareTo(typedOther.isSetAvgWeightedNlc());
567
    if (lastComparison != 0) {
568
      return lastComparison;
569
    }
570
    if (isSetAvgWeightedNlc()) {
571
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.avgWeightedNlc, typedOther.avgWeightedNlc);
572
      if (lastComparison != 0) {
573
        return lastComparison;
574
      }
575
    }
576
    return 0;
577
  }
578
 
579
  public _Fields fieldForId(int fieldId) {
580
    return _Fields.findByThriftId(fieldId);
581
  }
582
 
583
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
584
    org.apache.thrift.protocol.TField field;
585
    iprot.readStructBegin();
586
    while (true)
587
    {
588
      field = iprot.readFieldBegin();
589
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
590
        break;
591
      }
592
      switch (field.id) {
593
        case 1: // ITEM_ID
594
          if (field.type == org.apache.thrift.protocol.TType.I64) {
595
            this.itemId = iprot.readI64();
596
            setItemIdIsSet(true);
597
          } else { 
598
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
599
          }
600
          break;
601
        case 2: // SOURCE
602
          if (field.type == org.apache.thrift.protocol.TType.I64) {
603
            this.source = iprot.readI64();
604
            setSourceIsSet(true);
605
          } else { 
606
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
607
          }
608
          break;
609
        case 3: // UPDATED_TIMESTAMP
610
          if (field.type == org.apache.thrift.protocol.TType.I64) {
611
            this.updatedTimestamp = iprot.readI64();
612
            setUpdatedTimestampIsSet(true);
613
          } else { 
614
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
615
          }
616
          break;
617
        case 4: // STOCK_QUANTITY
618
          if (field.type == org.apache.thrift.protocol.TType.I64) {
619
            this.stockQuantity = iprot.readI64();
620
            setStockQuantityIsSet(true);
621
          } else { 
622
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
623
          }
624
          break;
625
        case 5: // GRN_DETAIL
626
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
627
            this.grnDetail = iprot.readString();
628
          } else { 
629
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
630
          }
631
          break;
632
        case 6: // AVG_WEIGHTED_NLC
633
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
634
            this.avgWeightedNlc = iprot.readDouble();
635
            setAvgWeightedNlcIsSet(true);
636
          } else { 
637
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
638
          }
639
          break;
640
        default:
641
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
642
      }
643
      iprot.readFieldEnd();
644
    }
645
    iprot.readStructEnd();
646
    validate();
647
  }
648
 
649
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
650
    validate();
651
 
652
    oprot.writeStructBegin(STRUCT_DESC);
653
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
654
    oprot.writeI64(this.itemId);
655
    oprot.writeFieldEnd();
656
    oprot.writeFieldBegin(SOURCE_FIELD_DESC);
657
    oprot.writeI64(this.source);
658
    oprot.writeFieldEnd();
659
    oprot.writeFieldBegin(UPDATED_TIMESTAMP_FIELD_DESC);
660
    oprot.writeI64(this.updatedTimestamp);
661
    oprot.writeFieldEnd();
662
    oprot.writeFieldBegin(STOCK_QUANTITY_FIELD_DESC);
663
    oprot.writeI64(this.stockQuantity);
664
    oprot.writeFieldEnd();
665
    if (this.grnDetail != null) {
666
      oprot.writeFieldBegin(GRN_DETAIL_FIELD_DESC);
667
      oprot.writeString(this.grnDetail);
668
      oprot.writeFieldEnd();
669
    }
670
    oprot.writeFieldBegin(AVG_WEIGHTED_NLC_FIELD_DESC);
671
    oprot.writeDouble(this.avgWeightedNlc);
672
    oprot.writeFieldEnd();
673
    oprot.writeFieldStop();
674
    oprot.writeStructEnd();
675
  }
676
 
677
  @Override
678
  public String toString() {
679
    StringBuilder sb = new StringBuilder("StockWeightedNlcInfo(");
680
    boolean first = true;
681
 
682
    sb.append("itemId:");
683
    sb.append(this.itemId);
684
    first = false;
685
    if (!first) sb.append(", ");
686
    sb.append("source:");
687
    sb.append(this.source);
688
    first = false;
689
    if (!first) sb.append(", ");
690
    sb.append("updatedTimestamp:");
691
    sb.append(this.updatedTimestamp);
692
    first = false;
693
    if (!first) sb.append(", ");
694
    sb.append("stockQuantity:");
695
    sb.append(this.stockQuantity);
696
    first = false;
697
    if (!first) sb.append(", ");
698
    sb.append("grnDetail:");
699
    if (this.grnDetail == null) {
700
      sb.append("null");
701
    } else {
702
      sb.append(this.grnDetail);
703
    }
704
    first = false;
705
    if (!first) sb.append(", ");
706
    sb.append("avgWeightedNlc:");
707
    sb.append(this.avgWeightedNlc);
708
    first = false;
709
    sb.append(")");
710
    return sb.toString();
711
  }
712
 
713
  public void validate() throws org.apache.thrift.TException {
714
    // check for required fields
715
  }
716
 
717
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
718
    try {
719
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
720
    } catch (org.apache.thrift.TException te) {
721
      throw new java.io.IOException(te);
722
    }
723
  }
724
 
725
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
726
    try {
727
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
728
      __isset_bit_vector = new BitSet(1);
729
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
730
    } catch (org.apache.thrift.TException te) {
731
      throw new java.io.IOException(te);
732
    }
733
  }
734
 
735
}
736