Subversion Repositories SmartDukaan

Rev

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