Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
68 ashish 1
/**
2
 * Autogenerated by Thrift
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.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class Transaction implements TBase<Transaction._Fields>, java.io.Serializable, Cloneable {
27
  private static final TStruct STRUCT_DESC = new TStruct("Transaction");
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
30
  private static final TField ORDER_INFO_FIELD_DESC = new TField("orderInfo", TType.STRUCT, (short)2);
31
  private static final TField SHIPMENT_INFO_FIELD_DESC = new TField("shipmentInfo", TType.STRUCT, (short)3);
32
  private static final TField BILLING_INFO_FIELD_DESC = new TField("billingInfo", TType.STRUCT, (short)4);
33
  private static final TField PAYMENT_INFO_FIELD_DESC = new TField("paymentInfo", TType.STRUCT, (short)5);
34
  private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)6);
35
  private static final TField EXPECTED_DELIVERY_TIME_FIELD_DESC = new TField("expectedDeliveryTime", TType.I64, (short)7);
36
  private static final TField TRANSACTION_STATUS_FIELD_DESC = new TField("transactionStatus", TType.I32, (short)8);
37
  private static final TField STATUS_DESCRIPTION_FIELD_DESC = new TField("statusDescription", TType.STRING, (short)9);
38
  private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customer_id", TType.I64, (short)10);
132 ashish 39
  private static final TField SHOPPING_CARTID_FIELD_DESC = new TField("shoppingCartid", TType.I64, (short)11);
68 ashish 40
 
41
  private long id;
42
  private OrderInfo orderInfo;
43
  private ShipmentInfo shipmentInfo;
44
  private BillingInfo billingInfo;
45
  private PaymentInfo paymentInfo;
46
  private long createdOn;
47
  private long expectedDeliveryTime;
48
  private TransactionStatus transactionStatus;
49
  private String statusDescription;
50
  private long customer_id;
132 ashish 51
  private long shoppingCartid;
68 ashish 52
 
53
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
54
  public enum _Fields implements TFieldIdEnum {
55
    ID((short)1, "id"),
56
    ORDER_INFO((short)2, "orderInfo"),
57
    SHIPMENT_INFO((short)3, "shipmentInfo"),
58
    BILLING_INFO((short)4, "billingInfo"),
59
    PAYMENT_INFO((short)5, "paymentInfo"),
60
    CREATED_ON((short)6, "createdOn"),
61
    EXPECTED_DELIVERY_TIME((short)7, "expectedDeliveryTime"),
62
    /**
63
     * 
64
     * @see TransactionStatus
65
     */
66
    TRANSACTION_STATUS((short)8, "transactionStatus"),
67
    STATUS_DESCRIPTION((short)9, "statusDescription"),
132 ashish 68
    CUSTOMER_ID((short)10, "customer_id"),
69
    SHOPPING_CARTID((short)11, "shoppingCartid");
68 ashish 70
 
71
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
72
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
73
 
74
    static {
75
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
76
        byId.put((int)field._thriftId, field);
77
        byName.put(field.getFieldName(), field);
78
      }
79
    }
80
 
81
    /**
82
     * Find the _Fields constant that matches fieldId, or null if its not found.
83
     */
84
    public static _Fields findByThriftId(int fieldId) {
85
      return byId.get(fieldId);
86
    }
87
 
88
    /**
89
     * Find the _Fields constant that matches fieldId, throwing an exception
90
     * if it is not found.
91
     */
92
    public static _Fields findByThriftIdOrThrow(int fieldId) {
93
      _Fields fields = findByThriftId(fieldId);
94
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
95
      return fields;
96
    }
97
 
98
    /**
99
     * Find the _Fields constant that matches name, or null if its not found.
100
     */
101
    public static _Fields findByName(String name) {
102
      return byName.get(name);
103
    }
104
 
105
    private final short _thriftId;
106
    private final String _fieldName;
107
 
108
    _Fields(short thriftId, String fieldName) {
109
      _thriftId = thriftId;
110
      _fieldName = fieldName;
111
    }
112
 
113
    public short getThriftFieldId() {
114
      return _thriftId;
115
    }
116
 
117
    public String getFieldName() {
118
      return _fieldName;
119
    }
120
  }
121
 
122
  // isset id assignments
123
  private static final int __ID_ISSET_ID = 0;
124
  private static final int __CREATEDON_ISSET_ID = 1;
125
  private static final int __EXPECTEDDELIVERYTIME_ISSET_ID = 2;
126
  private static final int __CUSTOMER_ID_ISSET_ID = 3;
132 ashish 127
  private static final int __SHOPPINGCARTID_ISSET_ID = 4;
128
  private BitSet __isset_bit_vector = new BitSet(5);
68 ashish 129
 
130
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
131
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
132
        new FieldValueMetaData(TType.I64)));
133
    put(_Fields.ORDER_INFO, new FieldMetaData("orderInfo", TFieldRequirementType.DEFAULT, 
134
        new StructMetaData(TType.STRUCT, OrderInfo.class)));
135
    put(_Fields.SHIPMENT_INFO, new FieldMetaData("shipmentInfo", TFieldRequirementType.DEFAULT, 
136
        new StructMetaData(TType.STRUCT, ShipmentInfo.class)));
137
    put(_Fields.BILLING_INFO, new FieldMetaData("billingInfo", TFieldRequirementType.DEFAULT, 
138
        new StructMetaData(TType.STRUCT, BillingInfo.class)));
139
    put(_Fields.PAYMENT_INFO, new FieldMetaData("paymentInfo", TFieldRequirementType.DEFAULT, 
140
        new StructMetaData(TType.STRUCT, PaymentInfo.class)));
141
    put(_Fields.CREATED_ON, new FieldMetaData("createdOn", TFieldRequirementType.DEFAULT, 
142
        new FieldValueMetaData(TType.I64)));
143
    put(_Fields.EXPECTED_DELIVERY_TIME, new FieldMetaData("expectedDeliveryTime", TFieldRequirementType.DEFAULT, 
144
        new FieldValueMetaData(TType.I64)));
145
    put(_Fields.TRANSACTION_STATUS, new FieldMetaData("transactionStatus", TFieldRequirementType.DEFAULT, 
146
        new EnumMetaData(TType.ENUM, TransactionStatus.class)));
147
    put(_Fields.STATUS_DESCRIPTION, new FieldMetaData("statusDescription", TFieldRequirementType.DEFAULT, 
148
        new FieldValueMetaData(TType.STRING)));
149
    put(_Fields.CUSTOMER_ID, new FieldMetaData("customer_id", TFieldRequirementType.DEFAULT, 
150
        new FieldValueMetaData(TType.I64)));
132 ashish 151
    put(_Fields.SHOPPING_CARTID, new FieldMetaData("shoppingCartid", TFieldRequirementType.DEFAULT, 
152
        new FieldValueMetaData(TType.I64)));
68 ashish 153
  }});
154
 
155
  static {
156
    FieldMetaData.addStructMetaDataMap(Transaction.class, metaDataMap);
157
  }
158
 
159
  public Transaction() {
160
  }
161
 
162
  public Transaction(
163
    long id,
164
    OrderInfo orderInfo,
165
    ShipmentInfo shipmentInfo,
166
    BillingInfo billingInfo,
167
    PaymentInfo paymentInfo,
168
    long createdOn,
169
    long expectedDeliveryTime,
170
    TransactionStatus transactionStatus,
171
    String statusDescription,
132 ashish 172
    long customer_id,
173
    long shoppingCartid)
68 ashish 174
  {
175
    this();
176
    this.id = id;
177
    setIdIsSet(true);
178
    this.orderInfo = orderInfo;
179
    this.shipmentInfo = shipmentInfo;
180
    this.billingInfo = billingInfo;
181
    this.paymentInfo = paymentInfo;
182
    this.createdOn = createdOn;
183
    setCreatedOnIsSet(true);
184
    this.expectedDeliveryTime = expectedDeliveryTime;
185
    setExpectedDeliveryTimeIsSet(true);
186
    this.transactionStatus = transactionStatus;
187
    this.statusDescription = statusDescription;
188
    this.customer_id = customer_id;
189
    setCustomer_idIsSet(true);
132 ashish 190
    this.shoppingCartid = shoppingCartid;
191
    setShoppingCartidIsSet(true);
68 ashish 192
  }
193
 
194
  /**
195
   * Performs a deep copy on <i>other</i>.
196
   */
197
  public Transaction(Transaction other) {
198
    __isset_bit_vector.clear();
199
    __isset_bit_vector.or(other.__isset_bit_vector);
200
    this.id = other.id;
201
    if (other.isSetOrderInfo()) {
202
      this.orderInfo = new OrderInfo(other.orderInfo);
203
    }
204
    if (other.isSetShipmentInfo()) {
205
      this.shipmentInfo = new ShipmentInfo(other.shipmentInfo);
206
    }
207
    if (other.isSetBillingInfo()) {
208
      this.billingInfo = new BillingInfo(other.billingInfo);
209
    }
210
    if (other.isSetPaymentInfo()) {
211
      this.paymentInfo = new PaymentInfo(other.paymentInfo);
212
    }
213
    this.createdOn = other.createdOn;
214
    this.expectedDeliveryTime = other.expectedDeliveryTime;
215
    if (other.isSetTransactionStatus()) {
216
      this.transactionStatus = other.transactionStatus;
217
    }
218
    if (other.isSetStatusDescription()) {
219
      this.statusDescription = other.statusDescription;
220
    }
221
    this.customer_id = other.customer_id;
132 ashish 222
    this.shoppingCartid = other.shoppingCartid;
68 ashish 223
  }
224
 
225
  public Transaction deepCopy() {
226
    return new Transaction(this);
227
  }
228
 
229
  @Deprecated
230
  public Transaction clone() {
231
    return new Transaction(this);
232
  }
233
 
234
  public long getId() {
235
    return this.id;
236
  }
237
 
238
  public Transaction setId(long id) {
239
    this.id = id;
240
    setIdIsSet(true);
241
    return this;
242
  }
243
 
244
  public void unsetId() {
245
    __isset_bit_vector.clear(__ID_ISSET_ID);
246
  }
247
 
248
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
249
  public boolean isSetId() {
250
    return __isset_bit_vector.get(__ID_ISSET_ID);
251
  }
252
 
253
  public void setIdIsSet(boolean value) {
254
    __isset_bit_vector.set(__ID_ISSET_ID, value);
255
  }
256
 
257
  public OrderInfo getOrderInfo() {
258
    return this.orderInfo;
259
  }
260
 
261
  public Transaction setOrderInfo(OrderInfo orderInfo) {
262
    this.orderInfo = orderInfo;
263
    return this;
264
  }
265
 
266
  public void unsetOrderInfo() {
267
    this.orderInfo = null;
268
  }
269
 
270
  /** Returns true if field orderInfo is set (has been asigned a value) and false otherwise */
271
  public boolean isSetOrderInfo() {
272
    return this.orderInfo != null;
273
  }
274
 
275
  public void setOrderInfoIsSet(boolean value) {
276
    if (!value) {
277
      this.orderInfo = null;
278
    }
279
  }
280
 
281
  public ShipmentInfo getShipmentInfo() {
282
    return this.shipmentInfo;
283
  }
284
 
285
  public Transaction setShipmentInfo(ShipmentInfo shipmentInfo) {
286
    this.shipmentInfo = shipmentInfo;
287
    return this;
288
  }
289
 
290
  public void unsetShipmentInfo() {
291
    this.shipmentInfo = null;
292
  }
293
 
294
  /** Returns true if field shipmentInfo is set (has been asigned a value) and false otherwise */
295
  public boolean isSetShipmentInfo() {
296
    return this.shipmentInfo != null;
297
  }
298
 
299
  public void setShipmentInfoIsSet(boolean value) {
300
    if (!value) {
301
      this.shipmentInfo = null;
302
    }
303
  }
304
 
305
  public BillingInfo getBillingInfo() {
306
    return this.billingInfo;
307
  }
308
 
309
  public Transaction setBillingInfo(BillingInfo billingInfo) {
310
    this.billingInfo = billingInfo;
311
    return this;
312
  }
313
 
314
  public void unsetBillingInfo() {
315
    this.billingInfo = null;
316
  }
317
 
318
  /** Returns true if field billingInfo is set (has been asigned a value) and false otherwise */
319
  public boolean isSetBillingInfo() {
320
    return this.billingInfo != null;
321
  }
322
 
323
  public void setBillingInfoIsSet(boolean value) {
324
    if (!value) {
325
      this.billingInfo = null;
326
    }
327
  }
328
 
329
  public PaymentInfo getPaymentInfo() {
330
    return this.paymentInfo;
331
  }
332
 
333
  public Transaction setPaymentInfo(PaymentInfo paymentInfo) {
334
    this.paymentInfo = paymentInfo;
335
    return this;
336
  }
337
 
338
  public void unsetPaymentInfo() {
339
    this.paymentInfo = null;
340
  }
341
 
342
  /** Returns true if field paymentInfo is set (has been asigned a value) and false otherwise */
343
  public boolean isSetPaymentInfo() {
344
    return this.paymentInfo != null;
345
  }
346
 
347
  public void setPaymentInfoIsSet(boolean value) {
348
    if (!value) {
349
      this.paymentInfo = null;
350
    }
351
  }
352
 
353
  public long getCreatedOn() {
354
    return this.createdOn;
355
  }
356
 
357
  public Transaction setCreatedOn(long createdOn) {
358
    this.createdOn = createdOn;
359
    setCreatedOnIsSet(true);
360
    return this;
361
  }
362
 
363
  public void unsetCreatedOn() {
364
    __isset_bit_vector.clear(__CREATEDON_ISSET_ID);
365
  }
366
 
367
  /** Returns true if field createdOn is set (has been asigned a value) and false otherwise */
368
  public boolean isSetCreatedOn() {
369
    return __isset_bit_vector.get(__CREATEDON_ISSET_ID);
370
  }
371
 
372
  public void setCreatedOnIsSet(boolean value) {
373
    __isset_bit_vector.set(__CREATEDON_ISSET_ID, value);
374
  }
375
 
376
  public long getExpectedDeliveryTime() {
377
    return this.expectedDeliveryTime;
378
  }
379
 
380
  public Transaction setExpectedDeliveryTime(long expectedDeliveryTime) {
381
    this.expectedDeliveryTime = expectedDeliveryTime;
382
    setExpectedDeliveryTimeIsSet(true);
383
    return this;
384
  }
385
 
386
  public void unsetExpectedDeliveryTime() {
387
    __isset_bit_vector.clear(__EXPECTEDDELIVERYTIME_ISSET_ID);
388
  }
389
 
390
  /** Returns true if field expectedDeliveryTime is set (has been asigned a value) and false otherwise */
391
  public boolean isSetExpectedDeliveryTime() {
392
    return __isset_bit_vector.get(__EXPECTEDDELIVERYTIME_ISSET_ID);
393
  }
394
 
395
  public void setExpectedDeliveryTimeIsSet(boolean value) {
396
    __isset_bit_vector.set(__EXPECTEDDELIVERYTIME_ISSET_ID, value);
397
  }
398
 
399
  /**
400
   * 
401
   * @see TransactionStatus
402
   */
403
  public TransactionStatus getTransactionStatus() {
404
    return this.transactionStatus;
405
  }
406
 
407
  /**
408
   * 
409
   * @see TransactionStatus
410
   */
411
  public Transaction setTransactionStatus(TransactionStatus transactionStatus) {
412
    this.transactionStatus = transactionStatus;
413
    return this;
414
  }
415
 
416
  public void unsetTransactionStatus() {
417
    this.transactionStatus = null;
418
  }
419
 
420
  /** Returns true if field transactionStatus is set (has been asigned a value) and false otherwise */
421
  public boolean isSetTransactionStatus() {
422
    return this.transactionStatus != null;
423
  }
424
 
425
  public void setTransactionStatusIsSet(boolean value) {
426
    if (!value) {
427
      this.transactionStatus = null;
428
    }
429
  }
430
 
431
  public String getStatusDescription() {
432
    return this.statusDescription;
433
  }
434
 
435
  public Transaction setStatusDescription(String statusDescription) {
436
    this.statusDescription = statusDescription;
437
    return this;
438
  }
439
 
440
  public void unsetStatusDescription() {
441
    this.statusDescription = null;
442
  }
443
 
444
  /** Returns true if field statusDescription is set (has been asigned a value) and false otherwise */
445
  public boolean isSetStatusDescription() {
446
    return this.statusDescription != null;
447
  }
448
 
449
  public void setStatusDescriptionIsSet(boolean value) {
450
    if (!value) {
451
      this.statusDescription = null;
452
    }
453
  }
454
 
455
  public long getCustomer_id() {
456
    return this.customer_id;
457
  }
458
 
459
  public Transaction setCustomer_id(long customer_id) {
460
    this.customer_id = customer_id;
461
    setCustomer_idIsSet(true);
462
    return this;
463
  }
464
 
465
  public void unsetCustomer_id() {
466
    __isset_bit_vector.clear(__CUSTOMER_ID_ISSET_ID);
467
  }
468
 
469
  /** Returns true if field customer_id is set (has been asigned a value) and false otherwise */
470
  public boolean isSetCustomer_id() {
471
    return __isset_bit_vector.get(__CUSTOMER_ID_ISSET_ID);
472
  }
473
 
474
  public void setCustomer_idIsSet(boolean value) {
475
    __isset_bit_vector.set(__CUSTOMER_ID_ISSET_ID, value);
476
  }
477
 
132 ashish 478
  public long getShoppingCartid() {
479
    return this.shoppingCartid;
480
  }
481
 
482
  public Transaction setShoppingCartid(long shoppingCartid) {
483
    this.shoppingCartid = shoppingCartid;
484
    setShoppingCartidIsSet(true);
485
    return this;
486
  }
487
 
488
  public void unsetShoppingCartid() {
489
    __isset_bit_vector.clear(__SHOPPINGCARTID_ISSET_ID);
490
  }
491
 
492
  /** Returns true if field shoppingCartid is set (has been asigned a value) and false otherwise */
493
  public boolean isSetShoppingCartid() {
494
    return __isset_bit_vector.get(__SHOPPINGCARTID_ISSET_ID);
495
  }
496
 
497
  public void setShoppingCartidIsSet(boolean value) {
498
    __isset_bit_vector.set(__SHOPPINGCARTID_ISSET_ID, value);
499
  }
500
 
68 ashish 501
  public void setFieldValue(_Fields field, Object value) {
502
    switch (field) {
503
    case ID:
504
      if (value == null) {
505
        unsetId();
506
      } else {
507
        setId((Long)value);
508
      }
509
      break;
510
 
511
    case ORDER_INFO:
512
      if (value == null) {
513
        unsetOrderInfo();
514
      } else {
515
        setOrderInfo((OrderInfo)value);
516
      }
517
      break;
518
 
519
    case SHIPMENT_INFO:
520
      if (value == null) {
521
        unsetShipmentInfo();
522
      } else {
523
        setShipmentInfo((ShipmentInfo)value);
524
      }
525
      break;
526
 
527
    case BILLING_INFO:
528
      if (value == null) {
529
        unsetBillingInfo();
530
      } else {
531
        setBillingInfo((BillingInfo)value);
532
      }
533
      break;
534
 
535
    case PAYMENT_INFO:
536
      if (value == null) {
537
        unsetPaymentInfo();
538
      } else {
539
        setPaymentInfo((PaymentInfo)value);
540
      }
541
      break;
542
 
543
    case CREATED_ON:
544
      if (value == null) {
545
        unsetCreatedOn();
546
      } else {
547
        setCreatedOn((Long)value);
548
      }
549
      break;
550
 
551
    case EXPECTED_DELIVERY_TIME:
552
      if (value == null) {
553
        unsetExpectedDeliveryTime();
554
      } else {
555
        setExpectedDeliveryTime((Long)value);
556
      }
557
      break;
558
 
559
    case TRANSACTION_STATUS:
560
      if (value == null) {
561
        unsetTransactionStatus();
562
      } else {
563
        setTransactionStatus((TransactionStatus)value);
564
      }
565
      break;
566
 
567
    case STATUS_DESCRIPTION:
568
      if (value == null) {
569
        unsetStatusDescription();
570
      } else {
571
        setStatusDescription((String)value);
572
      }
573
      break;
574
 
575
    case CUSTOMER_ID:
576
      if (value == null) {
577
        unsetCustomer_id();
578
      } else {
579
        setCustomer_id((Long)value);
580
      }
581
      break;
582
 
132 ashish 583
    case SHOPPING_CARTID:
584
      if (value == null) {
585
        unsetShoppingCartid();
586
      } else {
587
        setShoppingCartid((Long)value);
588
      }
589
      break;
590
 
68 ashish 591
    }
592
  }
593
 
594
  public void setFieldValue(int fieldID, Object value) {
595
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
596
  }
597
 
598
  public Object getFieldValue(_Fields field) {
599
    switch (field) {
600
    case ID:
601
      return new Long(getId());
602
 
603
    case ORDER_INFO:
604
      return getOrderInfo();
605
 
606
    case SHIPMENT_INFO:
607
      return getShipmentInfo();
608
 
609
    case BILLING_INFO:
610
      return getBillingInfo();
611
 
612
    case PAYMENT_INFO:
613
      return getPaymentInfo();
614
 
615
    case CREATED_ON:
616
      return new Long(getCreatedOn());
617
 
618
    case EXPECTED_DELIVERY_TIME:
619
      return new Long(getExpectedDeliveryTime());
620
 
621
    case TRANSACTION_STATUS:
622
      return getTransactionStatus();
623
 
624
    case STATUS_DESCRIPTION:
625
      return getStatusDescription();
626
 
627
    case CUSTOMER_ID:
628
      return new Long(getCustomer_id());
629
 
132 ashish 630
    case SHOPPING_CARTID:
631
      return new Long(getShoppingCartid());
632
 
68 ashish 633
    }
634
    throw new IllegalStateException();
635
  }
636
 
637
  public Object getFieldValue(int fieldId) {
638
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
639
  }
640
 
641
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
642
  public boolean isSet(_Fields field) {
643
    switch (field) {
644
    case ID:
645
      return isSetId();
646
    case ORDER_INFO:
647
      return isSetOrderInfo();
648
    case SHIPMENT_INFO:
649
      return isSetShipmentInfo();
650
    case BILLING_INFO:
651
      return isSetBillingInfo();
652
    case PAYMENT_INFO:
653
      return isSetPaymentInfo();
654
    case CREATED_ON:
655
      return isSetCreatedOn();
656
    case EXPECTED_DELIVERY_TIME:
657
      return isSetExpectedDeliveryTime();
658
    case TRANSACTION_STATUS:
659
      return isSetTransactionStatus();
660
    case STATUS_DESCRIPTION:
661
      return isSetStatusDescription();
662
    case CUSTOMER_ID:
663
      return isSetCustomer_id();
132 ashish 664
    case SHOPPING_CARTID:
665
      return isSetShoppingCartid();
68 ashish 666
    }
667
    throw new IllegalStateException();
668
  }
669
 
670
  public boolean isSet(int fieldID) {
671
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
672
  }
673
 
674
  @Override
675
  public boolean equals(Object that) {
676
    if (that == null)
677
      return false;
678
    if (that instanceof Transaction)
679
      return this.equals((Transaction)that);
680
    return false;
681
  }
682
 
683
  public boolean equals(Transaction that) {
684
    if (that == null)
685
      return false;
686
 
687
    boolean this_present_id = true;
688
    boolean that_present_id = true;
689
    if (this_present_id || that_present_id) {
690
      if (!(this_present_id && that_present_id))
691
        return false;
692
      if (this.id != that.id)
693
        return false;
694
    }
695
 
696
    boolean this_present_orderInfo = true && this.isSetOrderInfo();
697
    boolean that_present_orderInfo = true && that.isSetOrderInfo();
698
    if (this_present_orderInfo || that_present_orderInfo) {
699
      if (!(this_present_orderInfo && that_present_orderInfo))
700
        return false;
701
      if (!this.orderInfo.equals(that.orderInfo))
702
        return false;
703
    }
704
 
705
    boolean this_present_shipmentInfo = true && this.isSetShipmentInfo();
706
    boolean that_present_shipmentInfo = true && that.isSetShipmentInfo();
707
    if (this_present_shipmentInfo || that_present_shipmentInfo) {
708
      if (!(this_present_shipmentInfo && that_present_shipmentInfo))
709
        return false;
710
      if (!this.shipmentInfo.equals(that.shipmentInfo))
711
        return false;
712
    }
713
 
714
    boolean this_present_billingInfo = true && this.isSetBillingInfo();
715
    boolean that_present_billingInfo = true && that.isSetBillingInfo();
716
    if (this_present_billingInfo || that_present_billingInfo) {
717
      if (!(this_present_billingInfo && that_present_billingInfo))
718
        return false;
719
      if (!this.billingInfo.equals(that.billingInfo))
720
        return false;
721
    }
722
 
723
    boolean this_present_paymentInfo = true && this.isSetPaymentInfo();
724
    boolean that_present_paymentInfo = true && that.isSetPaymentInfo();
725
    if (this_present_paymentInfo || that_present_paymentInfo) {
726
      if (!(this_present_paymentInfo && that_present_paymentInfo))
727
        return false;
728
      if (!this.paymentInfo.equals(that.paymentInfo))
729
        return false;
730
    }
731
 
732
    boolean this_present_createdOn = true;
733
    boolean that_present_createdOn = true;
734
    if (this_present_createdOn || that_present_createdOn) {
735
      if (!(this_present_createdOn && that_present_createdOn))
736
        return false;
737
      if (this.createdOn != that.createdOn)
738
        return false;
739
    }
740
 
741
    boolean this_present_expectedDeliveryTime = true;
742
    boolean that_present_expectedDeliveryTime = true;
743
    if (this_present_expectedDeliveryTime || that_present_expectedDeliveryTime) {
744
      if (!(this_present_expectedDeliveryTime && that_present_expectedDeliveryTime))
745
        return false;
746
      if (this.expectedDeliveryTime != that.expectedDeliveryTime)
747
        return false;
748
    }
749
 
750
    boolean this_present_transactionStatus = true && this.isSetTransactionStatus();
751
    boolean that_present_transactionStatus = true && that.isSetTransactionStatus();
752
    if (this_present_transactionStatus || that_present_transactionStatus) {
753
      if (!(this_present_transactionStatus && that_present_transactionStatus))
754
        return false;
755
      if (!this.transactionStatus.equals(that.transactionStatus))
756
        return false;
757
    }
758
 
759
    boolean this_present_statusDescription = true && this.isSetStatusDescription();
760
    boolean that_present_statusDescription = true && that.isSetStatusDescription();
761
    if (this_present_statusDescription || that_present_statusDescription) {
762
      if (!(this_present_statusDescription && that_present_statusDescription))
763
        return false;
764
      if (!this.statusDescription.equals(that.statusDescription))
765
        return false;
766
    }
767
 
768
    boolean this_present_customer_id = true;
769
    boolean that_present_customer_id = true;
770
    if (this_present_customer_id || that_present_customer_id) {
771
      if (!(this_present_customer_id && that_present_customer_id))
772
        return false;
773
      if (this.customer_id != that.customer_id)
774
        return false;
775
    }
776
 
132 ashish 777
    boolean this_present_shoppingCartid = true;
778
    boolean that_present_shoppingCartid = true;
779
    if (this_present_shoppingCartid || that_present_shoppingCartid) {
780
      if (!(this_present_shoppingCartid && that_present_shoppingCartid))
781
        return false;
782
      if (this.shoppingCartid != that.shoppingCartid)
783
        return false;
784
    }
785
 
68 ashish 786
    return true;
787
  }
788
 
789
  @Override
790
  public int hashCode() {
791
    return 0;
792
  }
793
 
794
  public void read(TProtocol iprot) throws TException {
795
    TField field;
796
    iprot.readStructBegin();
797
    while (true)
798
    {
799
      field = iprot.readFieldBegin();
800
      if (field.type == TType.STOP) { 
801
        break;
802
      }
803
      _Fields fieldId = _Fields.findByThriftId(field.id);
804
      if (fieldId == null) {
805
        TProtocolUtil.skip(iprot, field.type);
806
      } else {
807
        switch (fieldId) {
808
          case ID:
809
            if (field.type == TType.I64) {
810
              this.id = iprot.readI64();
811
              setIdIsSet(true);
812
            } else { 
813
              TProtocolUtil.skip(iprot, field.type);
814
            }
815
            break;
816
          case ORDER_INFO:
817
            if (field.type == TType.STRUCT) {
818
              this.orderInfo = new OrderInfo();
819
              this.orderInfo.read(iprot);
820
            } else { 
821
              TProtocolUtil.skip(iprot, field.type);
822
            }
823
            break;
824
          case SHIPMENT_INFO:
825
            if (field.type == TType.STRUCT) {
826
              this.shipmentInfo = new ShipmentInfo();
827
              this.shipmentInfo.read(iprot);
828
            } else { 
829
              TProtocolUtil.skip(iprot, field.type);
830
            }
831
            break;
832
          case BILLING_INFO:
833
            if (field.type == TType.STRUCT) {
834
              this.billingInfo = new BillingInfo();
835
              this.billingInfo.read(iprot);
836
            } else { 
837
              TProtocolUtil.skip(iprot, field.type);
838
            }
839
            break;
840
          case PAYMENT_INFO:
841
            if (field.type == TType.STRUCT) {
842
              this.paymentInfo = new PaymentInfo();
843
              this.paymentInfo.read(iprot);
844
            } else { 
845
              TProtocolUtil.skip(iprot, field.type);
846
            }
847
            break;
848
          case CREATED_ON:
849
            if (field.type == TType.I64) {
850
              this.createdOn = iprot.readI64();
851
              setCreatedOnIsSet(true);
852
            } else { 
853
              TProtocolUtil.skip(iprot, field.type);
854
            }
855
            break;
856
          case EXPECTED_DELIVERY_TIME:
857
            if (field.type == TType.I64) {
858
              this.expectedDeliveryTime = iprot.readI64();
859
              setExpectedDeliveryTimeIsSet(true);
860
            } else { 
861
              TProtocolUtil.skip(iprot, field.type);
862
            }
863
            break;
864
          case TRANSACTION_STATUS:
865
            if (field.type == TType.I32) {
866
              this.transactionStatus = TransactionStatus.findByValue(iprot.readI32());
867
            } else { 
868
              TProtocolUtil.skip(iprot, field.type);
869
            }
870
            break;
871
          case STATUS_DESCRIPTION:
872
            if (field.type == TType.STRING) {
873
              this.statusDescription = iprot.readString();
874
            } else { 
875
              TProtocolUtil.skip(iprot, field.type);
876
            }
877
            break;
878
          case CUSTOMER_ID:
879
            if (field.type == TType.I64) {
880
              this.customer_id = iprot.readI64();
881
              setCustomer_idIsSet(true);
882
            } else { 
883
              TProtocolUtil.skip(iprot, field.type);
884
            }
885
            break;
132 ashish 886
          case SHOPPING_CARTID:
887
            if (field.type == TType.I64) {
888
              this.shoppingCartid = iprot.readI64();
889
              setShoppingCartidIsSet(true);
890
            } else { 
891
              TProtocolUtil.skip(iprot, field.type);
892
            }
893
            break;
68 ashish 894
        }
895
        iprot.readFieldEnd();
896
      }
897
    }
898
    iprot.readStructEnd();
899
    validate();
900
  }
901
 
902
  public void write(TProtocol oprot) throws TException {
903
    validate();
904
 
905
    oprot.writeStructBegin(STRUCT_DESC);
906
    oprot.writeFieldBegin(ID_FIELD_DESC);
907
    oprot.writeI64(this.id);
908
    oprot.writeFieldEnd();
909
    if (this.orderInfo != null) {
910
      oprot.writeFieldBegin(ORDER_INFO_FIELD_DESC);
911
      this.orderInfo.write(oprot);
912
      oprot.writeFieldEnd();
913
    }
914
    if (this.shipmentInfo != null) {
915
      oprot.writeFieldBegin(SHIPMENT_INFO_FIELD_DESC);
916
      this.shipmentInfo.write(oprot);
917
      oprot.writeFieldEnd();
918
    }
919
    if (this.billingInfo != null) {
920
      oprot.writeFieldBegin(BILLING_INFO_FIELD_DESC);
921
      this.billingInfo.write(oprot);
922
      oprot.writeFieldEnd();
923
    }
924
    if (this.paymentInfo != null) {
925
      oprot.writeFieldBegin(PAYMENT_INFO_FIELD_DESC);
926
      this.paymentInfo.write(oprot);
927
      oprot.writeFieldEnd();
928
    }
929
    oprot.writeFieldBegin(CREATED_ON_FIELD_DESC);
930
    oprot.writeI64(this.createdOn);
931
    oprot.writeFieldEnd();
932
    oprot.writeFieldBegin(EXPECTED_DELIVERY_TIME_FIELD_DESC);
933
    oprot.writeI64(this.expectedDeliveryTime);
934
    oprot.writeFieldEnd();
935
    if (this.transactionStatus != null) {
936
      oprot.writeFieldBegin(TRANSACTION_STATUS_FIELD_DESC);
937
      oprot.writeI32(this.transactionStatus.getValue());
938
      oprot.writeFieldEnd();
939
    }
940
    if (this.statusDescription != null) {
941
      oprot.writeFieldBegin(STATUS_DESCRIPTION_FIELD_DESC);
942
      oprot.writeString(this.statusDescription);
943
      oprot.writeFieldEnd();
944
    }
945
    oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
946
    oprot.writeI64(this.customer_id);
947
    oprot.writeFieldEnd();
132 ashish 948
    oprot.writeFieldBegin(SHOPPING_CARTID_FIELD_DESC);
949
    oprot.writeI64(this.shoppingCartid);
950
    oprot.writeFieldEnd();
68 ashish 951
    oprot.writeFieldStop();
952
    oprot.writeStructEnd();
953
  }
954
 
955
  @Override
956
  public String toString() {
957
    StringBuilder sb = new StringBuilder("Transaction(");
958
    boolean first = true;
959
 
960
    sb.append("id:");
961
    sb.append(this.id);
962
    first = false;
963
    if (!first) sb.append(", ");
964
    sb.append("orderInfo:");
965
    if (this.orderInfo == null) {
966
      sb.append("null");
967
    } else {
968
      sb.append(this.orderInfo);
969
    }
970
    first = false;
971
    if (!first) sb.append(", ");
972
    sb.append("shipmentInfo:");
973
    if (this.shipmentInfo == null) {
974
      sb.append("null");
975
    } else {
976
      sb.append(this.shipmentInfo);
977
    }
978
    first = false;
979
    if (!first) sb.append(", ");
980
    sb.append("billingInfo:");
981
    if (this.billingInfo == null) {
982
      sb.append("null");
983
    } else {
984
      sb.append(this.billingInfo);
985
    }
986
    first = false;
987
    if (!first) sb.append(", ");
988
    sb.append("paymentInfo:");
989
    if (this.paymentInfo == null) {
990
      sb.append("null");
991
    } else {
992
      sb.append(this.paymentInfo);
993
    }
994
    first = false;
995
    if (!first) sb.append(", ");
996
    sb.append("createdOn:");
997
    sb.append(this.createdOn);
998
    first = false;
999
    if (!first) sb.append(", ");
1000
    sb.append("expectedDeliveryTime:");
1001
    sb.append(this.expectedDeliveryTime);
1002
    first = false;
1003
    if (!first) sb.append(", ");
1004
    sb.append("transactionStatus:");
1005
    if (this.transactionStatus == null) {
1006
      sb.append("null");
1007
    } else {
1008
      String transactionStatus_name = transactionStatus.name();
1009
      if (transactionStatus_name != null) {
1010
        sb.append(transactionStatus_name);
1011
        sb.append(" (");
1012
      }
1013
      sb.append(this.transactionStatus);
1014
      if (transactionStatus_name != null) {
1015
        sb.append(")");
1016
      }
1017
    }
1018
    first = false;
1019
    if (!first) sb.append(", ");
1020
    sb.append("statusDescription:");
1021
    if (this.statusDescription == null) {
1022
      sb.append("null");
1023
    } else {
1024
      sb.append(this.statusDescription);
1025
    }
1026
    first = false;
1027
    if (!first) sb.append(", ");
1028
    sb.append("customer_id:");
1029
    sb.append(this.customer_id);
1030
    first = false;
132 ashish 1031
    if (!first) sb.append(", ");
1032
    sb.append("shoppingCartid:");
1033
    sb.append(this.shoppingCartid);
1034
    first = false;
68 ashish 1035
    sb.append(")");
1036
    return sb.toString();
1037
  }
1038
 
1039
  public void validate() throws TException {
1040
    // check for required fields
1041
  }
1042
 
1043
}
1044