Subversion Repositories SmartDukaan

Rev

Rev 7386 | Rev 7423 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7386 anupam.sin 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 StoreOrderDetail implements org.apache.thrift.TBase<StoreOrderDetail, StoreOrderDetail._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StoreOrderDetail");
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 STORE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("storeId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField ADVANCE_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("advanceAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
29
  private static final org.apache.thrift.protocol.TField CASH_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("cashAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
30
  private static final org.apache.thrift.protocol.TField CARD_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("cardAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
31
  private static final org.apache.thrift.protocol.TField PAY_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("payStatus", org.apache.thrift.protocol.TType.I32, (short)6);
7393 anupam.sin 32
  private static final org.apache.thrift.protocol.TField EDC_BANK_FIELD_DESC = new org.apache.thrift.protocol.TField("edcBank", org.apache.thrift.protocol.TType.STRING, (short)7);
33
  private static final org.apache.thrift.protocol.TField CASH_REFUND_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("cashRefundAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
34
  private static final org.apache.thrift.protocol.TField CARD_REFUND_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("cardRefundAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
7386 anupam.sin 35
 
36
  private long orderId; // required
37
  private long storeId; // required
38
  private double advanceAmount; // required
39
  private double cashAmount; // required
40
  private double cardAmount; // required
41
  private StorePaymentStatus payStatus; // required
7393 anupam.sin 42
  private String edcBank; // required
43
  private double cashRefundAmount; // required
44
  private double cardRefundAmount; // required
7386 anupam.sin 45
 
46
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
47
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
48
    ORDER_ID((short)1, "orderId"),
49
    STORE_ID((short)2, "storeId"),
50
    ADVANCE_AMOUNT((short)3, "advanceAmount"),
51
    CASH_AMOUNT((short)4, "cashAmount"),
52
    CARD_AMOUNT((short)5, "cardAmount"),
53
    /**
54
     * 
55
     * @see StorePaymentStatus
56
     */
7393 anupam.sin 57
    PAY_STATUS((short)6, "payStatus"),
58
    EDC_BANK((short)7, "edcBank"),
59
    CASH_REFUND_AMOUNT((short)8, "cashRefundAmount"),
60
    CARD_REFUND_AMOUNT((short)9, "cardRefundAmount");
7386 anupam.sin 61
 
62
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
63
 
64
    static {
65
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
66
        byName.put(field.getFieldName(), field);
67
      }
68
    }
69
 
70
    /**
71
     * Find the _Fields constant that matches fieldId, or null if its not found.
72
     */
73
    public static _Fields findByThriftId(int fieldId) {
74
      switch(fieldId) {
75
        case 1: // ORDER_ID
76
          return ORDER_ID;
77
        case 2: // STORE_ID
78
          return STORE_ID;
79
        case 3: // ADVANCE_AMOUNT
80
          return ADVANCE_AMOUNT;
81
        case 4: // CASH_AMOUNT
82
          return CASH_AMOUNT;
83
        case 5: // CARD_AMOUNT
84
          return CARD_AMOUNT;
85
        case 6: // PAY_STATUS
86
          return PAY_STATUS;
7393 anupam.sin 87
        case 7: // EDC_BANK
88
          return EDC_BANK;
89
        case 8: // CASH_REFUND_AMOUNT
90
          return CASH_REFUND_AMOUNT;
91
        case 9: // CARD_REFUND_AMOUNT
92
          return CARD_REFUND_AMOUNT;
7386 anupam.sin 93
        default:
94
          return null;
95
      }
96
    }
97
 
98
    /**
99
     * Find the _Fields constant that matches fieldId, throwing an exception
100
     * if it is not found.
101
     */
102
    public static _Fields findByThriftIdOrThrow(int fieldId) {
103
      _Fields fields = findByThriftId(fieldId);
104
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
105
      return fields;
106
    }
107
 
108
    /**
109
     * Find the _Fields constant that matches name, or null if its not found.
110
     */
111
    public static _Fields findByName(String name) {
112
      return byName.get(name);
113
    }
114
 
115
    private final short _thriftId;
116
    private final String _fieldName;
117
 
118
    _Fields(short thriftId, String fieldName) {
119
      _thriftId = thriftId;
120
      _fieldName = fieldName;
121
    }
122
 
123
    public short getThriftFieldId() {
124
      return _thriftId;
125
    }
126
 
127
    public String getFieldName() {
128
      return _fieldName;
129
    }
130
  }
131
 
132
  // isset id assignments
133
  private static final int __ORDERID_ISSET_ID = 0;
134
  private static final int __STOREID_ISSET_ID = 1;
135
  private static final int __ADVANCEAMOUNT_ISSET_ID = 2;
136
  private static final int __CASHAMOUNT_ISSET_ID = 3;
137
  private static final int __CARDAMOUNT_ISSET_ID = 4;
7393 anupam.sin 138
  private static final int __CASHREFUNDAMOUNT_ISSET_ID = 5;
139
  private static final int __CARDREFUNDAMOUNT_ISSET_ID = 6;
140
  private BitSet __isset_bit_vector = new BitSet(7);
7386 anupam.sin 141
 
142
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
143
  static {
144
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
145
    tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
147
    tmpMap.put(_Fields.STORE_ID, new org.apache.thrift.meta_data.FieldMetaData("storeId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
149
    tmpMap.put(_Fields.ADVANCE_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("advanceAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
151
    tmpMap.put(_Fields.CASH_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("cashAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
153
    tmpMap.put(_Fields.CARD_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("cardAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
155
    tmpMap.put(_Fields.PAY_STATUS, new org.apache.thrift.meta_data.FieldMetaData("payStatus", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, StorePaymentStatus.class)));
7393 anupam.sin 157
    tmpMap.put(_Fields.EDC_BANK, new org.apache.thrift.meta_data.FieldMetaData("edcBank", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
159
    tmpMap.put(_Fields.CASH_REFUND_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("cashRefundAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
160
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
161
    tmpMap.put(_Fields.CARD_REFUND_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("cardRefundAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
162
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
7386 anupam.sin 163
    metaDataMap = Collections.unmodifiableMap(tmpMap);
164
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StoreOrderDetail.class, metaDataMap);
165
  }
166
 
167
  public StoreOrderDetail() {
168
  }
169
 
170
  public StoreOrderDetail(
171
    long orderId,
172
    long storeId,
173
    double advanceAmount,
174
    double cashAmount,
175
    double cardAmount,
7393 anupam.sin 176
    StorePaymentStatus payStatus,
177
    String edcBank,
178
    double cashRefundAmount,
179
    double cardRefundAmount)
7386 anupam.sin 180
  {
181
    this();
182
    this.orderId = orderId;
183
    setOrderIdIsSet(true);
184
    this.storeId = storeId;
185
    setStoreIdIsSet(true);
186
    this.advanceAmount = advanceAmount;
187
    setAdvanceAmountIsSet(true);
188
    this.cashAmount = cashAmount;
189
    setCashAmountIsSet(true);
190
    this.cardAmount = cardAmount;
191
    setCardAmountIsSet(true);
192
    this.payStatus = payStatus;
7393 anupam.sin 193
    this.edcBank = edcBank;
194
    this.cashRefundAmount = cashRefundAmount;
195
    setCashRefundAmountIsSet(true);
196
    this.cardRefundAmount = cardRefundAmount;
197
    setCardRefundAmountIsSet(true);
7386 anupam.sin 198
  }
199
 
200
  /**
201
   * Performs a deep copy on <i>other</i>.
202
   */
203
  public StoreOrderDetail(StoreOrderDetail other) {
204
    __isset_bit_vector.clear();
205
    __isset_bit_vector.or(other.__isset_bit_vector);
206
    this.orderId = other.orderId;
207
    this.storeId = other.storeId;
208
    this.advanceAmount = other.advanceAmount;
209
    this.cashAmount = other.cashAmount;
210
    this.cardAmount = other.cardAmount;
211
    if (other.isSetPayStatus()) {
212
      this.payStatus = other.payStatus;
213
    }
7393 anupam.sin 214
    if (other.isSetEdcBank()) {
215
      this.edcBank = other.edcBank;
216
    }
217
    this.cashRefundAmount = other.cashRefundAmount;
218
    this.cardRefundAmount = other.cardRefundAmount;
7386 anupam.sin 219
  }
220
 
221
  public StoreOrderDetail deepCopy() {
222
    return new StoreOrderDetail(this);
223
  }
224
 
225
  @Override
226
  public void clear() {
227
    setOrderIdIsSet(false);
228
    this.orderId = 0;
229
    setStoreIdIsSet(false);
230
    this.storeId = 0;
231
    setAdvanceAmountIsSet(false);
232
    this.advanceAmount = 0.0;
233
    setCashAmountIsSet(false);
234
    this.cashAmount = 0.0;
235
    setCardAmountIsSet(false);
236
    this.cardAmount = 0.0;
237
    this.payStatus = null;
7393 anupam.sin 238
    this.edcBank = null;
239
    setCashRefundAmountIsSet(false);
240
    this.cashRefundAmount = 0.0;
241
    setCardRefundAmountIsSet(false);
242
    this.cardRefundAmount = 0.0;
7386 anupam.sin 243
  }
244
 
245
  public long getOrderId() {
246
    return this.orderId;
247
  }
248
 
249
  public void setOrderId(long orderId) {
250
    this.orderId = orderId;
251
    setOrderIdIsSet(true);
252
  }
253
 
254
  public void unsetOrderId() {
255
    __isset_bit_vector.clear(__ORDERID_ISSET_ID);
256
  }
257
 
258
  /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
259
  public boolean isSetOrderId() {
260
    return __isset_bit_vector.get(__ORDERID_ISSET_ID);
261
  }
262
 
263
  public void setOrderIdIsSet(boolean value) {
264
    __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
265
  }
266
 
267
  public long getStoreId() {
268
    return this.storeId;
269
  }
270
 
271
  public void setStoreId(long storeId) {
272
    this.storeId = storeId;
273
    setStoreIdIsSet(true);
274
  }
275
 
276
  public void unsetStoreId() {
277
    __isset_bit_vector.clear(__STOREID_ISSET_ID);
278
  }
279
 
280
  /** Returns true if field storeId is set (has been assigned a value) and false otherwise */
281
  public boolean isSetStoreId() {
282
    return __isset_bit_vector.get(__STOREID_ISSET_ID);
283
  }
284
 
285
  public void setStoreIdIsSet(boolean value) {
286
    __isset_bit_vector.set(__STOREID_ISSET_ID, value);
287
  }
288
 
289
  public double getAdvanceAmount() {
290
    return this.advanceAmount;
291
  }
292
 
293
  public void setAdvanceAmount(double advanceAmount) {
294
    this.advanceAmount = advanceAmount;
295
    setAdvanceAmountIsSet(true);
296
  }
297
 
298
  public void unsetAdvanceAmount() {
299
    __isset_bit_vector.clear(__ADVANCEAMOUNT_ISSET_ID);
300
  }
301
 
302
  /** Returns true if field advanceAmount is set (has been assigned a value) and false otherwise */
303
  public boolean isSetAdvanceAmount() {
304
    return __isset_bit_vector.get(__ADVANCEAMOUNT_ISSET_ID);
305
  }
306
 
307
  public void setAdvanceAmountIsSet(boolean value) {
308
    __isset_bit_vector.set(__ADVANCEAMOUNT_ISSET_ID, value);
309
  }
310
 
311
  public double getCashAmount() {
312
    return this.cashAmount;
313
  }
314
 
315
  public void setCashAmount(double cashAmount) {
316
    this.cashAmount = cashAmount;
317
    setCashAmountIsSet(true);
318
  }
319
 
320
  public void unsetCashAmount() {
321
    __isset_bit_vector.clear(__CASHAMOUNT_ISSET_ID);
322
  }
323
 
324
  /** Returns true if field cashAmount is set (has been assigned a value) and false otherwise */
325
  public boolean isSetCashAmount() {
326
    return __isset_bit_vector.get(__CASHAMOUNT_ISSET_ID);
327
  }
328
 
329
  public void setCashAmountIsSet(boolean value) {
330
    __isset_bit_vector.set(__CASHAMOUNT_ISSET_ID, value);
331
  }
332
 
333
  public double getCardAmount() {
334
    return this.cardAmount;
335
  }
336
 
337
  public void setCardAmount(double cardAmount) {
338
    this.cardAmount = cardAmount;
339
    setCardAmountIsSet(true);
340
  }
341
 
342
  public void unsetCardAmount() {
343
    __isset_bit_vector.clear(__CARDAMOUNT_ISSET_ID);
344
  }
345
 
346
  /** Returns true if field cardAmount is set (has been assigned a value) and false otherwise */
347
  public boolean isSetCardAmount() {
348
    return __isset_bit_vector.get(__CARDAMOUNT_ISSET_ID);
349
  }
350
 
351
  public void setCardAmountIsSet(boolean value) {
352
    __isset_bit_vector.set(__CARDAMOUNT_ISSET_ID, value);
353
  }
354
 
355
  /**
356
   * 
357
   * @see StorePaymentStatus
358
   */
359
  public StorePaymentStatus getPayStatus() {
360
    return this.payStatus;
361
  }
362
 
363
  /**
364
   * 
365
   * @see StorePaymentStatus
366
   */
367
  public void setPayStatus(StorePaymentStatus payStatus) {
368
    this.payStatus = payStatus;
369
  }
370
 
371
  public void unsetPayStatus() {
372
    this.payStatus = null;
373
  }
374
 
375
  /** Returns true if field payStatus is set (has been assigned a value) and false otherwise */
376
  public boolean isSetPayStatus() {
377
    return this.payStatus != null;
378
  }
379
 
380
  public void setPayStatusIsSet(boolean value) {
381
    if (!value) {
382
      this.payStatus = null;
383
    }
384
  }
385
 
7393 anupam.sin 386
  public String getEdcBank() {
387
    return this.edcBank;
388
  }
389
 
390
  public void setEdcBank(String edcBank) {
391
    this.edcBank = edcBank;
392
  }
393
 
394
  public void unsetEdcBank() {
395
    this.edcBank = null;
396
  }
397
 
398
  /** Returns true if field edcBank is set (has been assigned a value) and false otherwise */
399
  public boolean isSetEdcBank() {
400
    return this.edcBank != null;
401
  }
402
 
403
  public void setEdcBankIsSet(boolean value) {
404
    if (!value) {
405
      this.edcBank = null;
406
    }
407
  }
408
 
409
  public double getCashRefundAmount() {
410
    return this.cashRefundAmount;
411
  }
412
 
413
  public void setCashRefundAmount(double cashRefundAmount) {
414
    this.cashRefundAmount = cashRefundAmount;
415
    setCashRefundAmountIsSet(true);
416
  }
417
 
418
  public void unsetCashRefundAmount() {
419
    __isset_bit_vector.clear(__CASHREFUNDAMOUNT_ISSET_ID);
420
  }
421
 
422
  /** Returns true if field cashRefundAmount is set (has been assigned a value) and false otherwise */
423
  public boolean isSetCashRefundAmount() {
424
    return __isset_bit_vector.get(__CASHREFUNDAMOUNT_ISSET_ID);
425
  }
426
 
427
  public void setCashRefundAmountIsSet(boolean value) {
428
    __isset_bit_vector.set(__CASHREFUNDAMOUNT_ISSET_ID, value);
429
  }
430
 
431
  public double getCardRefundAmount() {
432
    return this.cardRefundAmount;
433
  }
434
 
435
  public void setCardRefundAmount(double cardRefundAmount) {
436
    this.cardRefundAmount = cardRefundAmount;
437
    setCardRefundAmountIsSet(true);
438
  }
439
 
440
  public void unsetCardRefundAmount() {
441
    __isset_bit_vector.clear(__CARDREFUNDAMOUNT_ISSET_ID);
442
  }
443
 
444
  /** Returns true if field cardRefundAmount is set (has been assigned a value) and false otherwise */
445
  public boolean isSetCardRefundAmount() {
446
    return __isset_bit_vector.get(__CARDREFUNDAMOUNT_ISSET_ID);
447
  }
448
 
449
  public void setCardRefundAmountIsSet(boolean value) {
450
    __isset_bit_vector.set(__CARDREFUNDAMOUNT_ISSET_ID, value);
451
  }
452
 
7386 anupam.sin 453
  public void setFieldValue(_Fields field, Object value) {
454
    switch (field) {
455
    case ORDER_ID:
456
      if (value == null) {
457
        unsetOrderId();
458
      } else {
459
        setOrderId((Long)value);
460
      }
461
      break;
462
 
463
    case STORE_ID:
464
      if (value == null) {
465
        unsetStoreId();
466
      } else {
467
        setStoreId((Long)value);
468
      }
469
      break;
470
 
471
    case ADVANCE_AMOUNT:
472
      if (value == null) {
473
        unsetAdvanceAmount();
474
      } else {
475
        setAdvanceAmount((Double)value);
476
      }
477
      break;
478
 
479
    case CASH_AMOUNT:
480
      if (value == null) {
481
        unsetCashAmount();
482
      } else {
483
        setCashAmount((Double)value);
484
      }
485
      break;
486
 
487
    case CARD_AMOUNT:
488
      if (value == null) {
489
        unsetCardAmount();
490
      } else {
491
        setCardAmount((Double)value);
492
      }
493
      break;
494
 
495
    case PAY_STATUS:
496
      if (value == null) {
497
        unsetPayStatus();
498
      } else {
499
        setPayStatus((StorePaymentStatus)value);
500
      }
501
      break;
502
 
7393 anupam.sin 503
    case EDC_BANK:
504
      if (value == null) {
505
        unsetEdcBank();
506
      } else {
507
        setEdcBank((String)value);
508
      }
509
      break;
510
 
511
    case CASH_REFUND_AMOUNT:
512
      if (value == null) {
513
        unsetCashRefundAmount();
514
      } else {
515
        setCashRefundAmount((Double)value);
516
      }
517
      break;
518
 
519
    case CARD_REFUND_AMOUNT:
520
      if (value == null) {
521
        unsetCardRefundAmount();
522
      } else {
523
        setCardRefundAmount((Double)value);
524
      }
525
      break;
526
 
7386 anupam.sin 527
    }
528
  }
529
 
530
  public Object getFieldValue(_Fields field) {
531
    switch (field) {
532
    case ORDER_ID:
533
      return Long.valueOf(getOrderId());
534
 
535
    case STORE_ID:
536
      return Long.valueOf(getStoreId());
537
 
538
    case ADVANCE_AMOUNT:
539
      return Double.valueOf(getAdvanceAmount());
540
 
541
    case CASH_AMOUNT:
542
      return Double.valueOf(getCashAmount());
543
 
544
    case CARD_AMOUNT:
545
      return Double.valueOf(getCardAmount());
546
 
547
    case PAY_STATUS:
548
      return getPayStatus();
549
 
7393 anupam.sin 550
    case EDC_BANK:
551
      return getEdcBank();
552
 
553
    case CASH_REFUND_AMOUNT:
554
      return Double.valueOf(getCashRefundAmount());
555
 
556
    case CARD_REFUND_AMOUNT:
557
      return Double.valueOf(getCardRefundAmount());
558
 
7386 anupam.sin 559
    }
560
    throw new IllegalStateException();
561
  }
562
 
563
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
564
  public boolean isSet(_Fields field) {
565
    if (field == null) {
566
      throw new IllegalArgumentException();
567
    }
568
 
569
    switch (field) {
570
    case ORDER_ID:
571
      return isSetOrderId();
572
    case STORE_ID:
573
      return isSetStoreId();
574
    case ADVANCE_AMOUNT:
575
      return isSetAdvanceAmount();
576
    case CASH_AMOUNT:
577
      return isSetCashAmount();
578
    case CARD_AMOUNT:
579
      return isSetCardAmount();
580
    case PAY_STATUS:
581
      return isSetPayStatus();
7393 anupam.sin 582
    case EDC_BANK:
583
      return isSetEdcBank();
584
    case CASH_REFUND_AMOUNT:
585
      return isSetCashRefundAmount();
586
    case CARD_REFUND_AMOUNT:
587
      return isSetCardRefundAmount();
7386 anupam.sin 588
    }
589
    throw new IllegalStateException();
590
  }
591
 
592
  @Override
593
  public boolean equals(Object that) {
594
    if (that == null)
595
      return false;
596
    if (that instanceof StoreOrderDetail)
597
      return this.equals((StoreOrderDetail)that);
598
    return false;
599
  }
600
 
601
  public boolean equals(StoreOrderDetail that) {
602
    if (that == null)
603
      return false;
604
 
605
    boolean this_present_orderId = true;
606
    boolean that_present_orderId = true;
607
    if (this_present_orderId || that_present_orderId) {
608
      if (!(this_present_orderId && that_present_orderId))
609
        return false;
610
      if (this.orderId != that.orderId)
611
        return false;
612
    }
613
 
614
    boolean this_present_storeId = true;
615
    boolean that_present_storeId = true;
616
    if (this_present_storeId || that_present_storeId) {
617
      if (!(this_present_storeId && that_present_storeId))
618
        return false;
619
      if (this.storeId != that.storeId)
620
        return false;
621
    }
622
 
623
    boolean this_present_advanceAmount = true;
624
    boolean that_present_advanceAmount = true;
625
    if (this_present_advanceAmount || that_present_advanceAmount) {
626
      if (!(this_present_advanceAmount && that_present_advanceAmount))
627
        return false;
628
      if (this.advanceAmount != that.advanceAmount)
629
        return false;
630
    }
631
 
632
    boolean this_present_cashAmount = true;
633
    boolean that_present_cashAmount = true;
634
    if (this_present_cashAmount || that_present_cashAmount) {
635
      if (!(this_present_cashAmount && that_present_cashAmount))
636
        return false;
637
      if (this.cashAmount != that.cashAmount)
638
        return false;
639
    }
640
 
641
    boolean this_present_cardAmount = true;
642
    boolean that_present_cardAmount = true;
643
    if (this_present_cardAmount || that_present_cardAmount) {
644
      if (!(this_present_cardAmount && that_present_cardAmount))
645
        return false;
646
      if (this.cardAmount != that.cardAmount)
647
        return false;
648
    }
649
 
650
    boolean this_present_payStatus = true && this.isSetPayStatus();
651
    boolean that_present_payStatus = true && that.isSetPayStatus();
652
    if (this_present_payStatus || that_present_payStatus) {
653
      if (!(this_present_payStatus && that_present_payStatus))
654
        return false;
655
      if (!this.payStatus.equals(that.payStatus))
656
        return false;
657
    }
658
 
7393 anupam.sin 659
    boolean this_present_edcBank = true && this.isSetEdcBank();
660
    boolean that_present_edcBank = true && that.isSetEdcBank();
661
    if (this_present_edcBank || that_present_edcBank) {
662
      if (!(this_present_edcBank && that_present_edcBank))
663
        return false;
664
      if (!this.edcBank.equals(that.edcBank))
665
        return false;
666
    }
667
 
668
    boolean this_present_cashRefundAmount = true;
669
    boolean that_present_cashRefundAmount = true;
670
    if (this_present_cashRefundAmount || that_present_cashRefundAmount) {
671
      if (!(this_present_cashRefundAmount && that_present_cashRefundAmount))
672
        return false;
673
      if (this.cashRefundAmount != that.cashRefundAmount)
674
        return false;
675
    }
676
 
677
    boolean this_present_cardRefundAmount = true;
678
    boolean that_present_cardRefundAmount = true;
679
    if (this_present_cardRefundAmount || that_present_cardRefundAmount) {
680
      if (!(this_present_cardRefundAmount && that_present_cardRefundAmount))
681
        return false;
682
      if (this.cardRefundAmount != that.cardRefundAmount)
683
        return false;
684
    }
685
 
7386 anupam.sin 686
    return true;
687
  }
688
 
689
  @Override
690
  public int hashCode() {
691
    return 0;
692
  }
693
 
694
  public int compareTo(StoreOrderDetail other) {
695
    if (!getClass().equals(other.getClass())) {
696
      return getClass().getName().compareTo(other.getClass().getName());
697
    }
698
 
699
    int lastComparison = 0;
700
    StoreOrderDetail typedOther = (StoreOrderDetail)other;
701
 
702
    lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
703
    if (lastComparison != 0) {
704
      return lastComparison;
705
    }
706
    if (isSetOrderId()) {
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
708
      if (lastComparison != 0) {
709
        return lastComparison;
710
      }
711
    }
712
    lastComparison = Boolean.valueOf(isSetStoreId()).compareTo(typedOther.isSetStoreId());
713
    if (lastComparison != 0) {
714
      return lastComparison;
715
    }
716
    if (isSetStoreId()) {
717
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storeId, typedOther.storeId);
718
      if (lastComparison != 0) {
719
        return lastComparison;
720
      }
721
    }
722
    lastComparison = Boolean.valueOf(isSetAdvanceAmount()).compareTo(typedOther.isSetAdvanceAmount());
723
    if (lastComparison != 0) {
724
      return lastComparison;
725
    }
726
    if (isSetAdvanceAmount()) {
727
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.advanceAmount, typedOther.advanceAmount);
728
      if (lastComparison != 0) {
729
        return lastComparison;
730
      }
731
    }
732
    lastComparison = Boolean.valueOf(isSetCashAmount()).compareTo(typedOther.isSetCashAmount());
733
    if (lastComparison != 0) {
734
      return lastComparison;
735
    }
736
    if (isSetCashAmount()) {
737
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cashAmount, typedOther.cashAmount);
738
      if (lastComparison != 0) {
739
        return lastComparison;
740
      }
741
    }
742
    lastComparison = Boolean.valueOf(isSetCardAmount()).compareTo(typedOther.isSetCardAmount());
743
    if (lastComparison != 0) {
744
      return lastComparison;
745
    }
746
    if (isSetCardAmount()) {
747
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cardAmount, typedOther.cardAmount);
748
      if (lastComparison != 0) {
749
        return lastComparison;
750
      }
751
    }
752
    lastComparison = Boolean.valueOf(isSetPayStatus()).compareTo(typedOther.isSetPayStatus());
753
    if (lastComparison != 0) {
754
      return lastComparison;
755
    }
756
    if (isSetPayStatus()) {
757
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payStatus, typedOther.payStatus);
758
      if (lastComparison != 0) {
759
        return lastComparison;
760
      }
761
    }
7393 anupam.sin 762
    lastComparison = Boolean.valueOf(isSetEdcBank()).compareTo(typedOther.isSetEdcBank());
763
    if (lastComparison != 0) {
764
      return lastComparison;
765
    }
766
    if (isSetEdcBank()) {
767
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.edcBank, typedOther.edcBank);
768
      if (lastComparison != 0) {
769
        return lastComparison;
770
      }
771
    }
772
    lastComparison = Boolean.valueOf(isSetCashRefundAmount()).compareTo(typedOther.isSetCashRefundAmount());
773
    if (lastComparison != 0) {
774
      return lastComparison;
775
    }
776
    if (isSetCashRefundAmount()) {
777
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cashRefundAmount, typedOther.cashRefundAmount);
778
      if (lastComparison != 0) {
779
        return lastComparison;
780
      }
781
    }
782
    lastComparison = Boolean.valueOf(isSetCardRefundAmount()).compareTo(typedOther.isSetCardRefundAmount());
783
    if (lastComparison != 0) {
784
      return lastComparison;
785
    }
786
    if (isSetCardRefundAmount()) {
787
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cardRefundAmount, typedOther.cardRefundAmount);
788
      if (lastComparison != 0) {
789
        return lastComparison;
790
      }
791
    }
7386 anupam.sin 792
    return 0;
793
  }
794
 
795
  public _Fields fieldForId(int fieldId) {
796
    return _Fields.findByThriftId(fieldId);
797
  }
798
 
799
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
800
    org.apache.thrift.protocol.TField field;
801
    iprot.readStructBegin();
802
    while (true)
803
    {
804
      field = iprot.readFieldBegin();
805
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
806
        break;
807
      }
808
      switch (field.id) {
809
        case 1: // ORDER_ID
810
          if (field.type == org.apache.thrift.protocol.TType.I64) {
811
            this.orderId = iprot.readI64();
812
            setOrderIdIsSet(true);
813
          } else { 
814
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
815
          }
816
          break;
817
        case 2: // STORE_ID
818
          if (field.type == org.apache.thrift.protocol.TType.I64) {
819
            this.storeId = iprot.readI64();
820
            setStoreIdIsSet(true);
821
          } else { 
822
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
823
          }
824
          break;
825
        case 3: // ADVANCE_AMOUNT
826
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
827
            this.advanceAmount = iprot.readDouble();
828
            setAdvanceAmountIsSet(true);
829
          } else { 
830
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
831
          }
832
          break;
833
        case 4: // CASH_AMOUNT
834
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
835
            this.cashAmount = iprot.readDouble();
836
            setCashAmountIsSet(true);
837
          } else { 
838
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
839
          }
840
          break;
841
        case 5: // CARD_AMOUNT
842
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
843
            this.cardAmount = iprot.readDouble();
844
            setCardAmountIsSet(true);
845
          } else { 
846
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
847
          }
848
          break;
849
        case 6: // PAY_STATUS
850
          if (field.type == org.apache.thrift.protocol.TType.I32) {
851
            this.payStatus = StorePaymentStatus.findByValue(iprot.readI32());
852
          } else { 
853
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
854
          }
855
          break;
7393 anupam.sin 856
        case 7: // EDC_BANK
857
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
858
            this.edcBank = iprot.readString();
859
          } else { 
860
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
861
          }
862
          break;
863
        case 8: // CASH_REFUND_AMOUNT
864
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
865
            this.cashRefundAmount = iprot.readDouble();
866
            setCashRefundAmountIsSet(true);
867
          } else { 
868
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
869
          }
870
          break;
871
        case 9: // CARD_REFUND_AMOUNT
872
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
873
            this.cardRefundAmount = iprot.readDouble();
874
            setCardRefundAmountIsSet(true);
875
          } else { 
876
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
877
          }
878
          break;
7386 anupam.sin 879
        default:
880
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
881
      }
882
      iprot.readFieldEnd();
883
    }
884
    iprot.readStructEnd();
885
    validate();
886
  }
887
 
888
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
889
    validate();
890
 
891
    oprot.writeStructBegin(STRUCT_DESC);
892
    oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
893
    oprot.writeI64(this.orderId);
894
    oprot.writeFieldEnd();
895
    oprot.writeFieldBegin(STORE_ID_FIELD_DESC);
896
    oprot.writeI64(this.storeId);
897
    oprot.writeFieldEnd();
898
    oprot.writeFieldBegin(ADVANCE_AMOUNT_FIELD_DESC);
899
    oprot.writeDouble(this.advanceAmount);
900
    oprot.writeFieldEnd();
901
    oprot.writeFieldBegin(CASH_AMOUNT_FIELD_DESC);
902
    oprot.writeDouble(this.cashAmount);
903
    oprot.writeFieldEnd();
904
    oprot.writeFieldBegin(CARD_AMOUNT_FIELD_DESC);
905
    oprot.writeDouble(this.cardAmount);
906
    oprot.writeFieldEnd();
907
    if (this.payStatus != null) {
908
      oprot.writeFieldBegin(PAY_STATUS_FIELD_DESC);
909
      oprot.writeI32(this.payStatus.getValue());
910
      oprot.writeFieldEnd();
911
    }
7393 anupam.sin 912
    if (this.edcBank != null) {
913
      oprot.writeFieldBegin(EDC_BANK_FIELD_DESC);
914
      oprot.writeString(this.edcBank);
915
      oprot.writeFieldEnd();
916
    }
917
    oprot.writeFieldBegin(CASH_REFUND_AMOUNT_FIELD_DESC);
918
    oprot.writeDouble(this.cashRefundAmount);
919
    oprot.writeFieldEnd();
920
    oprot.writeFieldBegin(CARD_REFUND_AMOUNT_FIELD_DESC);
921
    oprot.writeDouble(this.cardRefundAmount);
922
    oprot.writeFieldEnd();
7386 anupam.sin 923
    oprot.writeFieldStop();
924
    oprot.writeStructEnd();
925
  }
926
 
927
  @Override
928
  public String toString() {
929
    StringBuilder sb = new StringBuilder("StoreOrderDetail(");
930
    boolean first = true;
931
 
932
    sb.append("orderId:");
933
    sb.append(this.orderId);
934
    first = false;
935
    if (!first) sb.append(", ");
936
    sb.append("storeId:");
937
    sb.append(this.storeId);
938
    first = false;
939
    if (!first) sb.append(", ");
940
    sb.append("advanceAmount:");
941
    sb.append(this.advanceAmount);
942
    first = false;
943
    if (!first) sb.append(", ");
944
    sb.append("cashAmount:");
945
    sb.append(this.cashAmount);
946
    first = false;
947
    if (!first) sb.append(", ");
948
    sb.append("cardAmount:");
949
    sb.append(this.cardAmount);
950
    first = false;
951
    if (!first) sb.append(", ");
952
    sb.append("payStatus:");
953
    if (this.payStatus == null) {
954
      sb.append("null");
955
    } else {
956
      sb.append(this.payStatus);
957
    }
958
    first = false;
7393 anupam.sin 959
    if (!first) sb.append(", ");
960
    sb.append("edcBank:");
961
    if (this.edcBank == null) {
962
      sb.append("null");
963
    } else {
964
      sb.append(this.edcBank);
965
    }
966
    first = false;
967
    if (!first) sb.append(", ");
968
    sb.append("cashRefundAmount:");
969
    sb.append(this.cashRefundAmount);
970
    first = false;
971
    if (!first) sb.append(", ");
972
    sb.append("cardRefundAmount:");
973
    sb.append(this.cardRefundAmount);
974
    first = false;
7386 anupam.sin 975
    sb.append(")");
976
    return sb.toString();
977
  }
978
 
979
  public void validate() throws org.apache.thrift.TException {
980
    // check for required fields
981
  }
982
 
983
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
984
    try {
985
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
986
    } catch (org.apache.thrift.TException te) {
987
      throw new java.io.IOException(te);
988
    }
989
  }
990
 
991
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
992
    try {
993
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
994
      __isset_bit_vector = new BitSet(1);
995
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
996
    } catch (org.apache.thrift.TException te) {
997
      throw new java.io.IOException(te);
998
    }
999
  }
1000
 
1001
}
1002