Subversion Repositories SmartDukaan

Rev

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