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