Subversion Repositories SmartDukaan

Rev

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