Subversion Repositories SmartDukaan

Rev

Rev 8488 | Go to most recent revision | 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);
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.I64, (short)3);
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
36
  private long subOrderId; // required
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;
120
  private static final int __SUBORDERID_ISSET_ID = 1;
121
  private static final int __LISTINGPRICE_ISSET_ID = 2;
122
  private static final int __SNAPDEALTXNDATE_ISSET_ID = 3;
9456 vikram.rag 123
  private static final int __MAXNLC_ISSET_ID = 4;
124
  private BitSet __isset_bit_vector = new BitSet(5);
8488 amar.kumar 125
 
126
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
127
  static {
128
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
129
    tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
130
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
131
    tmpMap.put(_Fields.REFERENCE_CODE, new org.apache.thrift.meta_data.FieldMetaData("referenceCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
132
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
133
    tmpMap.put(_Fields.SUB_ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("subOrderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
134
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
135
    tmpMap.put(_Fields.LISTING_PRICE, new org.apache.thrift.meta_data.FieldMetaData("listingPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
136
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
137
    tmpMap.put(_Fields.PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("productName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
138
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
139
    tmpMap.put(_Fields.SNAPDEAL_TXN_DATE, new org.apache.thrift.meta_data.FieldMetaData("snapdealTxnDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
140
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9456 vikram.rag 141
    tmpMap.put(_Fields.MAX_NLC, new org.apache.thrift.meta_data.FieldMetaData("maxNlc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
8488 amar.kumar 143
    metaDataMap = Collections.unmodifiableMap(tmpMap);
144
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SnapdealOrder.class, metaDataMap);
145
  }
146
 
147
  public SnapdealOrder() {
148
  }
149
 
150
  public SnapdealOrder(
151
    long orderId,
152
    String referenceCode,
153
    long subOrderId,
154
    double listingPrice,
155
    String productName,
9456 vikram.rag 156
    long snapdealTxnDate,
157
    double maxNlc)
8488 amar.kumar 158
  {
159
    this();
160
    this.orderId = orderId;
161
    setOrderIdIsSet(true);
162
    this.referenceCode = referenceCode;
163
    this.subOrderId = subOrderId;
164
    setSubOrderIdIsSet(true);
165
    this.listingPrice = listingPrice;
166
    setListingPriceIsSet(true);
167
    this.productName = productName;
168
    this.snapdealTxnDate = snapdealTxnDate;
169
    setSnapdealTxnDateIsSet(true);
9456 vikram.rag 170
    this.maxNlc = maxNlc;
171
    setMaxNlcIsSet(true);
8488 amar.kumar 172
  }
173
 
174
  /**
175
   * Performs a deep copy on <i>other</i>.
176
   */
177
  public SnapdealOrder(SnapdealOrder other) {
178
    __isset_bit_vector.clear();
179
    __isset_bit_vector.or(other.__isset_bit_vector);
180
    this.orderId = other.orderId;
181
    if (other.isSetReferenceCode()) {
182
      this.referenceCode = other.referenceCode;
183
    }
184
    this.subOrderId = other.subOrderId;
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;
202
    setSubOrderIdIsSet(false);
203
    this.subOrderId = 0;
204
    setListingPriceIsSet(false);
205
    this.listingPrice = 0.0;
206
    this.productName = null;
207
    setSnapdealTxnDateIsSet(false);
208
    this.snapdealTxnDate = 0;
9456 vikram.rag 209
    setMaxNlcIsSet(false);
210
    this.maxNlc = 0.0;
8488 amar.kumar 211
  }
212
 
213
  public long getOrderId() {
214
    return this.orderId;
215
  }
216
 
217
  public void setOrderId(long orderId) {
218
    this.orderId = orderId;
219
    setOrderIdIsSet(true);
220
  }
221
 
222
  public void unsetOrderId() {
223
    __isset_bit_vector.clear(__ORDERID_ISSET_ID);
224
  }
225
 
226
  /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
227
  public boolean isSetOrderId() {
228
    return __isset_bit_vector.get(__ORDERID_ISSET_ID);
229
  }
230
 
231
  public void setOrderIdIsSet(boolean value) {
232
    __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
233
  }
234
 
235
  public String getReferenceCode() {
236
    return this.referenceCode;
237
  }
238
 
239
  public void setReferenceCode(String referenceCode) {
240
    this.referenceCode = referenceCode;
241
  }
242
 
243
  public void unsetReferenceCode() {
244
    this.referenceCode = null;
245
  }
246
 
247
  /** Returns true if field referenceCode is set (has been assigned a value) and false otherwise */
248
  public boolean isSetReferenceCode() {
249
    return this.referenceCode != null;
250
  }
251
 
252
  public void setReferenceCodeIsSet(boolean value) {
253
    if (!value) {
254
      this.referenceCode = null;
255
    }
256
  }
257
 
258
  public long getSubOrderId() {
259
    return this.subOrderId;
260
  }
261
 
262
  public void setSubOrderId(long subOrderId) {
263
    this.subOrderId = subOrderId;
264
    setSubOrderIdIsSet(true);
265
  }
266
 
267
  public void unsetSubOrderId() {
268
    __isset_bit_vector.clear(__SUBORDERID_ISSET_ID);
269
  }
270
 
271
  /** Returns true if field subOrderId is set (has been assigned a value) and false otherwise */
272
  public boolean isSetSubOrderId() {
273
    return __isset_bit_vector.get(__SUBORDERID_ISSET_ID);
274
  }
275
 
276
  public void setSubOrderIdIsSet(boolean value) {
277
    __isset_bit_vector.set(__SUBORDERID_ISSET_ID, value);
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 {
391
        setSubOrderId((Long)value);
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:
439
      return Long.valueOf(getSubOrderId());
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
 
513
    boolean this_present_subOrderId = true;
514
    boolean that_present_subOrderId = true;
515
    if (this_present_subOrderId || that_present_subOrderId) {
516
      if (!(this_present_subOrderId && that_present_subOrderId))
517
        return false;
518
      if (this.subOrderId != that.subOrderId)
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
677
          if (field.type == org.apache.thrift.protocol.TType.I64) {
678
            this.subOrderId = iprot.readI64();
679
            setSubOrderIdIsSet(true);
680
          } else { 
681
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
682
          }
683
          break;
684
        case 4: // LISTING_PRICE
685
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
686
            this.listingPrice = iprot.readDouble();
687
            setListingPriceIsSet(true);
688
          } else { 
689
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
690
          }
691
          break;
692
        case 5: // PRODUCT_NAME
693
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
694
            this.productName = iprot.readString();
695
          } else { 
696
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
697
          }
698
          break;
699
        case 6: // SNAPDEAL_TXN_DATE
700
          if (field.type == org.apache.thrift.protocol.TType.I64) {
701
            this.snapdealTxnDate = iprot.readI64();
702
            setSnapdealTxnDateIsSet(true);
703
          } else { 
704
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
705
          }
706
          break;
9456 vikram.rag 707
        case 7: // MAX_NLC
708
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
709
            this.maxNlc = iprot.readDouble();
710
            setMaxNlcIsSet(true);
711
          } else { 
712
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
713
          }
714
          break;
8488 amar.kumar 715
        default:
716
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
717
      }
718
      iprot.readFieldEnd();
719
    }
720
    iprot.readStructEnd();
721
    validate();
722
  }
723
 
724
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
725
    validate();
726
 
727
    oprot.writeStructBegin(STRUCT_DESC);
728
    oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
729
    oprot.writeI64(this.orderId);
730
    oprot.writeFieldEnd();
731
    if (this.referenceCode != null) {
732
      oprot.writeFieldBegin(REFERENCE_CODE_FIELD_DESC);
733
      oprot.writeString(this.referenceCode);
734
      oprot.writeFieldEnd();
735
    }
736
    oprot.writeFieldBegin(SUB_ORDER_ID_FIELD_DESC);
737
    oprot.writeI64(this.subOrderId);
738
    oprot.writeFieldEnd();
739
    oprot.writeFieldBegin(LISTING_PRICE_FIELD_DESC);
740
    oprot.writeDouble(this.listingPrice);
741
    oprot.writeFieldEnd();
742
    if (this.productName != null) {
743
      oprot.writeFieldBegin(PRODUCT_NAME_FIELD_DESC);
744
      oprot.writeString(this.productName);
745
      oprot.writeFieldEnd();
746
    }
747
    oprot.writeFieldBegin(SNAPDEAL_TXN_DATE_FIELD_DESC);
748
    oprot.writeI64(this.snapdealTxnDate);
749
    oprot.writeFieldEnd();
9456 vikram.rag 750
    oprot.writeFieldBegin(MAX_NLC_FIELD_DESC);
751
    oprot.writeDouble(this.maxNlc);
752
    oprot.writeFieldEnd();
8488 amar.kumar 753
    oprot.writeFieldStop();
754
    oprot.writeStructEnd();
755
  }
756
 
757
  @Override
758
  public String toString() {
759
    StringBuilder sb = new StringBuilder("SnapdealOrder(");
760
    boolean first = true;
761
 
762
    sb.append("orderId:");
763
    sb.append(this.orderId);
764
    first = false;
765
    if (!first) sb.append(", ");
766
    sb.append("referenceCode:");
767
    if (this.referenceCode == null) {
768
      sb.append("null");
769
    } else {
770
      sb.append(this.referenceCode);
771
    }
772
    first = false;
773
    if (!first) sb.append(", ");
774
    sb.append("subOrderId:");
775
    sb.append(this.subOrderId);
776
    first = false;
777
    if (!first) sb.append(", ");
778
    sb.append("listingPrice:");
779
    sb.append(this.listingPrice);
780
    first = false;
781
    if (!first) sb.append(", ");
782
    sb.append("productName:");
783
    if (this.productName == null) {
784
      sb.append("null");
785
    } else {
786
      sb.append(this.productName);
787
    }
788
    first = false;
789
    if (!first) sb.append(", ");
790
    sb.append("snapdealTxnDate:");
791
    sb.append(this.snapdealTxnDate);
792
    first = false;
9456 vikram.rag 793
    if (!first) sb.append(", ");
794
    sb.append("maxNlc:");
795
    sb.append(this.maxNlc);
796
    first = false;
8488 amar.kumar 797
    sb.append(")");
798
    return sb.toString();
799
  }
800
 
801
  public void validate() throws org.apache.thrift.TException {
802
    // check for required fields
803
  }
804
 
805
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
806
    try {
807
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
808
    } catch (org.apache.thrift.TException te) {
809
      throw new java.io.IOException(te);
810
    }
811
  }
812
 
813
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
814
    try {
815
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
816
      __isset_bit_vector = new BitSet(1);
817
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
818
    } catch (org.apache.thrift.TException te) {
819
      throw new java.io.IOException(te);
820
    }
821
  }
822
 
823
}
824