Subversion Repositories SmartDukaan

Rev

Rev 9456 | Details | Compare with Previous | Last modification | View Log | RSS feed

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