Subversion Repositories SmartDukaan

Rev

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