Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6000 mandeep.dh 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.order;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class RechargeCoupon implements org.apache.thrift.TBase<RechargeCoupon, RechargeCoupon._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RechargeCoupon");
25
 
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField CREATING_TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("creatingTransactionId", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField CONSUMING_TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("consumingTransactionId", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)5);
31
  private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)6);
32
  private static final org.apache.thrift.protocol.TField CREATION_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTimestamp", org.apache.thrift.protocol.TType.I64, (short)7);
33
  private static final org.apache.thrift.protocol.TField CONSUMED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("consumedTimestamp", org.apache.thrift.protocol.TType.I64, (short)8);
34
  private static final org.apache.thrift.protocol.TField CUSTOMER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("customerId", org.apache.thrift.protocol.TType.I64, (short)9);
35
  private static final org.apache.thrift.protocol.TField CUSTOMER_EMAIL_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("customerEmailId", org.apache.thrift.protocol.TType.I64, (short)10);
36
  private static final org.apache.thrift.protocol.TField EXPIRY_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("expiryTimestamp", org.apache.thrift.protocol.TType.I64, (short)11);
37
 
38
  private long id; // required
39
  private long amount; // required
40
  private long creatingTransactionId; // required
41
  private long consumingTransactionId; // required
42
  private RechargeCouponStatus status; // required
43
  private String couponCode; // required
44
  private long creationTimestamp; // required
45
  private long consumedTimestamp; // required
46
  private long customerId; // required
47
  private long customerEmailId; // required
48
  private long expiryTimestamp; // required
49
 
50
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
51
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
52
    ID((short)1, "id"),
53
    AMOUNT((short)2, "amount"),
54
    CREATING_TRANSACTION_ID((short)3, "creatingTransactionId"),
55
    CONSUMING_TRANSACTION_ID((short)4, "consumingTransactionId"),
56
    /**
57
     * 
58
     * @see RechargeCouponStatus
59
     */
60
    STATUS((short)5, "status"),
61
    COUPON_CODE((short)6, "couponCode"),
62
    CREATION_TIMESTAMP((short)7, "creationTimestamp"),
63
    CONSUMED_TIMESTAMP((short)8, "consumedTimestamp"),
64
    CUSTOMER_ID((short)9, "customerId"),
65
    CUSTOMER_EMAIL_ID((short)10, "customerEmailId"),
66
    EXPIRY_TIMESTAMP((short)11, "expiryTimestamp");
67
 
68
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
69
 
70
    static {
71
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
72
        byName.put(field.getFieldName(), field);
73
      }
74
    }
75
 
76
    /**
77
     * Find the _Fields constant that matches fieldId, or null if its not found.
78
     */
79
    public static _Fields findByThriftId(int fieldId) {
80
      switch(fieldId) {
81
        case 1: // ID
82
          return ID;
83
        case 2: // AMOUNT
84
          return AMOUNT;
85
        case 3: // CREATING_TRANSACTION_ID
86
          return CREATING_TRANSACTION_ID;
87
        case 4: // CONSUMING_TRANSACTION_ID
88
          return CONSUMING_TRANSACTION_ID;
89
        case 5: // STATUS
90
          return STATUS;
91
        case 6: // COUPON_CODE
92
          return COUPON_CODE;
93
        case 7: // CREATION_TIMESTAMP
94
          return CREATION_TIMESTAMP;
95
        case 8: // CONSUMED_TIMESTAMP
96
          return CONSUMED_TIMESTAMP;
97
        case 9: // CUSTOMER_ID
98
          return CUSTOMER_ID;
99
        case 10: // CUSTOMER_EMAIL_ID
100
          return CUSTOMER_EMAIL_ID;
101
        case 11: // EXPIRY_TIMESTAMP
102
          return EXPIRY_TIMESTAMP;
103
        default:
104
          return null;
105
      }
106
    }
107
 
108
    /**
109
     * Find the _Fields constant that matches fieldId, throwing an exception
110
     * if it is not found.
111
     */
112
    public static _Fields findByThriftIdOrThrow(int fieldId) {
113
      _Fields fields = findByThriftId(fieldId);
114
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
115
      return fields;
116
    }
117
 
118
    /**
119
     * Find the _Fields constant that matches name, or null if its not found.
120
     */
121
    public static _Fields findByName(String name) {
122
      return byName.get(name);
123
    }
124
 
125
    private final short _thriftId;
126
    private final String _fieldName;
127
 
128
    _Fields(short thriftId, String fieldName) {
129
      _thriftId = thriftId;
130
      _fieldName = fieldName;
131
    }
132
 
133
    public short getThriftFieldId() {
134
      return _thriftId;
135
    }
136
 
137
    public String getFieldName() {
138
      return _fieldName;
139
    }
140
  }
141
 
142
  // isset id assignments
143
  private static final int __ID_ISSET_ID = 0;
144
  private static final int __AMOUNT_ISSET_ID = 1;
145
  private static final int __CREATINGTRANSACTIONID_ISSET_ID = 2;
146
  private static final int __CONSUMINGTRANSACTIONID_ISSET_ID = 3;
147
  private static final int __CREATIONTIMESTAMP_ISSET_ID = 4;
148
  private static final int __CONSUMEDTIMESTAMP_ISSET_ID = 5;
149
  private static final int __CUSTOMERID_ISSET_ID = 6;
150
  private static final int __CUSTOMEREMAILID_ISSET_ID = 7;
151
  private static final int __EXPIRYTIMESTAMP_ISSET_ID = 8;
152
  private BitSet __isset_bit_vector = new BitSet(9);
153
 
154
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
155
  static {
156
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
157
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
159
    tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
160
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
161
    tmpMap.put(_Fields.CREATING_TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("creatingTransactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
162
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
163
    tmpMap.put(_Fields.CONSUMING_TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("consumingTransactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
164
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
165
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
166
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, RechargeCouponStatus.class)));
167
    tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
168
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
169
    tmpMap.put(_Fields.CREATION_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("creationTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
170
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
171
    tmpMap.put(_Fields.CONSUMED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("consumedTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
172
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
173
    tmpMap.put(_Fields.CUSTOMER_ID, new org.apache.thrift.meta_data.FieldMetaData("customerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
174
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
175
    tmpMap.put(_Fields.CUSTOMER_EMAIL_ID, new org.apache.thrift.meta_data.FieldMetaData("customerEmailId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
176
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
177
    tmpMap.put(_Fields.EXPIRY_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("expiryTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
178
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
179
    metaDataMap = Collections.unmodifiableMap(tmpMap);
180
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RechargeCoupon.class, metaDataMap);
181
  }
182
 
183
  public RechargeCoupon() {
184
  }
185
 
186
  public RechargeCoupon(
187
    long id,
188
    long amount,
189
    long creatingTransactionId,
190
    long consumingTransactionId,
191
    RechargeCouponStatus status,
192
    String couponCode,
193
    long creationTimestamp,
194
    long consumedTimestamp,
195
    long customerId,
196
    long customerEmailId,
197
    long expiryTimestamp)
198
  {
199
    this();
200
    this.id = id;
201
    setIdIsSet(true);
202
    this.amount = amount;
203
    setAmountIsSet(true);
204
    this.creatingTransactionId = creatingTransactionId;
205
    setCreatingTransactionIdIsSet(true);
206
    this.consumingTransactionId = consumingTransactionId;
207
    setConsumingTransactionIdIsSet(true);
208
    this.status = status;
209
    this.couponCode = couponCode;
210
    this.creationTimestamp = creationTimestamp;
211
    setCreationTimestampIsSet(true);
212
    this.consumedTimestamp = consumedTimestamp;
213
    setConsumedTimestampIsSet(true);
214
    this.customerId = customerId;
215
    setCustomerIdIsSet(true);
216
    this.customerEmailId = customerEmailId;
217
    setCustomerEmailIdIsSet(true);
218
    this.expiryTimestamp = expiryTimestamp;
219
    setExpiryTimestampIsSet(true);
220
  }
221
 
222
  /**
223
   * Performs a deep copy on <i>other</i>.
224
   */
225
  public RechargeCoupon(RechargeCoupon other) {
226
    __isset_bit_vector.clear();
227
    __isset_bit_vector.or(other.__isset_bit_vector);
228
    this.id = other.id;
229
    this.amount = other.amount;
230
    this.creatingTransactionId = other.creatingTransactionId;
231
    this.consumingTransactionId = other.consumingTransactionId;
232
    if (other.isSetStatus()) {
233
      this.status = other.status;
234
    }
235
    if (other.isSetCouponCode()) {
236
      this.couponCode = other.couponCode;
237
    }
238
    this.creationTimestamp = other.creationTimestamp;
239
    this.consumedTimestamp = other.consumedTimestamp;
240
    this.customerId = other.customerId;
241
    this.customerEmailId = other.customerEmailId;
242
    this.expiryTimestamp = other.expiryTimestamp;
243
  }
244
 
245
  public RechargeCoupon deepCopy() {
246
    return new RechargeCoupon(this);
247
  }
248
 
249
  @Override
250
  public void clear() {
251
    setIdIsSet(false);
252
    this.id = 0;
253
    setAmountIsSet(false);
254
    this.amount = 0;
255
    setCreatingTransactionIdIsSet(false);
256
    this.creatingTransactionId = 0;
257
    setConsumingTransactionIdIsSet(false);
258
    this.consumingTransactionId = 0;
259
    this.status = null;
260
    this.couponCode = null;
261
    setCreationTimestampIsSet(false);
262
    this.creationTimestamp = 0;
263
    setConsumedTimestampIsSet(false);
264
    this.consumedTimestamp = 0;
265
    setCustomerIdIsSet(false);
266
    this.customerId = 0;
267
    setCustomerEmailIdIsSet(false);
268
    this.customerEmailId = 0;
269
    setExpiryTimestampIsSet(false);
270
    this.expiryTimestamp = 0;
271
  }
272
 
273
  public long getId() {
274
    return this.id;
275
  }
276
 
277
  public void setId(long id) {
278
    this.id = id;
279
    setIdIsSet(true);
280
  }
281
 
282
  public void unsetId() {
283
    __isset_bit_vector.clear(__ID_ISSET_ID);
284
  }
285
 
286
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
287
  public boolean isSetId() {
288
    return __isset_bit_vector.get(__ID_ISSET_ID);
289
  }
290
 
291
  public void setIdIsSet(boolean value) {
292
    __isset_bit_vector.set(__ID_ISSET_ID, value);
293
  }
294
 
295
  public long getAmount() {
296
    return this.amount;
297
  }
298
 
299
  public void setAmount(long amount) {
300
    this.amount = amount;
301
    setAmountIsSet(true);
302
  }
303
 
304
  public void unsetAmount() {
305
    __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
306
  }
307
 
308
  /** Returns true if field amount is set (has been assigned a value) and false otherwise */
309
  public boolean isSetAmount() {
310
    return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
311
  }
312
 
313
  public void setAmountIsSet(boolean value) {
314
    __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
315
  }
316
 
317
  public long getCreatingTransactionId() {
318
    return this.creatingTransactionId;
319
  }
320
 
321
  public void setCreatingTransactionId(long creatingTransactionId) {
322
    this.creatingTransactionId = creatingTransactionId;
323
    setCreatingTransactionIdIsSet(true);
324
  }
325
 
326
  public void unsetCreatingTransactionId() {
327
    __isset_bit_vector.clear(__CREATINGTRANSACTIONID_ISSET_ID);
328
  }
329
 
330
  /** Returns true if field creatingTransactionId is set (has been assigned a value) and false otherwise */
331
  public boolean isSetCreatingTransactionId() {
332
    return __isset_bit_vector.get(__CREATINGTRANSACTIONID_ISSET_ID);
333
  }
334
 
335
  public void setCreatingTransactionIdIsSet(boolean value) {
336
    __isset_bit_vector.set(__CREATINGTRANSACTIONID_ISSET_ID, value);
337
  }
338
 
339
  public long getConsumingTransactionId() {
340
    return this.consumingTransactionId;
341
  }
342
 
343
  public void setConsumingTransactionId(long consumingTransactionId) {
344
    this.consumingTransactionId = consumingTransactionId;
345
    setConsumingTransactionIdIsSet(true);
346
  }
347
 
348
  public void unsetConsumingTransactionId() {
349
    __isset_bit_vector.clear(__CONSUMINGTRANSACTIONID_ISSET_ID);
350
  }
351
 
352
  /** Returns true if field consumingTransactionId is set (has been assigned a value) and false otherwise */
353
  public boolean isSetConsumingTransactionId() {
354
    return __isset_bit_vector.get(__CONSUMINGTRANSACTIONID_ISSET_ID);
355
  }
356
 
357
  public void setConsumingTransactionIdIsSet(boolean value) {
358
    __isset_bit_vector.set(__CONSUMINGTRANSACTIONID_ISSET_ID, value);
359
  }
360
 
361
  /**
362
   * 
363
   * @see RechargeCouponStatus
364
   */
365
  public RechargeCouponStatus getStatus() {
366
    return this.status;
367
  }
368
 
369
  /**
370
   * 
371
   * @see RechargeCouponStatus
372
   */
373
  public void setStatus(RechargeCouponStatus status) {
374
    this.status = status;
375
  }
376
 
377
  public void unsetStatus() {
378
    this.status = null;
379
  }
380
 
381
  /** Returns true if field status is set (has been assigned a value) and false otherwise */
382
  public boolean isSetStatus() {
383
    return this.status != null;
384
  }
385
 
386
  public void setStatusIsSet(boolean value) {
387
    if (!value) {
388
      this.status = null;
389
    }
390
  }
391
 
392
  public String getCouponCode() {
393
    return this.couponCode;
394
  }
395
 
396
  public void setCouponCode(String couponCode) {
397
    this.couponCode = couponCode;
398
  }
399
 
400
  public void unsetCouponCode() {
401
    this.couponCode = null;
402
  }
403
 
404
  /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
405
  public boolean isSetCouponCode() {
406
    return this.couponCode != null;
407
  }
408
 
409
  public void setCouponCodeIsSet(boolean value) {
410
    if (!value) {
411
      this.couponCode = null;
412
    }
413
  }
414
 
415
  public long getCreationTimestamp() {
416
    return this.creationTimestamp;
417
  }
418
 
419
  public void setCreationTimestamp(long creationTimestamp) {
420
    this.creationTimestamp = creationTimestamp;
421
    setCreationTimestampIsSet(true);
422
  }
423
 
424
  public void unsetCreationTimestamp() {
425
    __isset_bit_vector.clear(__CREATIONTIMESTAMP_ISSET_ID);
426
  }
427
 
428
  /** Returns true if field creationTimestamp is set (has been assigned a value) and false otherwise */
429
  public boolean isSetCreationTimestamp() {
430
    return __isset_bit_vector.get(__CREATIONTIMESTAMP_ISSET_ID);
431
  }
432
 
433
  public void setCreationTimestampIsSet(boolean value) {
434
    __isset_bit_vector.set(__CREATIONTIMESTAMP_ISSET_ID, value);
435
  }
436
 
437
  public long getConsumedTimestamp() {
438
    return this.consumedTimestamp;
439
  }
440
 
441
  public void setConsumedTimestamp(long consumedTimestamp) {
442
    this.consumedTimestamp = consumedTimestamp;
443
    setConsumedTimestampIsSet(true);
444
  }
445
 
446
  public void unsetConsumedTimestamp() {
447
    __isset_bit_vector.clear(__CONSUMEDTIMESTAMP_ISSET_ID);
448
  }
449
 
450
  /** Returns true if field consumedTimestamp is set (has been assigned a value) and false otherwise */
451
  public boolean isSetConsumedTimestamp() {
452
    return __isset_bit_vector.get(__CONSUMEDTIMESTAMP_ISSET_ID);
453
  }
454
 
455
  public void setConsumedTimestampIsSet(boolean value) {
456
    __isset_bit_vector.set(__CONSUMEDTIMESTAMP_ISSET_ID, value);
457
  }
458
 
459
  public long getCustomerId() {
460
    return this.customerId;
461
  }
462
 
463
  public void setCustomerId(long customerId) {
464
    this.customerId = customerId;
465
    setCustomerIdIsSet(true);
466
  }
467
 
468
  public void unsetCustomerId() {
469
    __isset_bit_vector.clear(__CUSTOMERID_ISSET_ID);
470
  }
471
 
472
  /** Returns true if field customerId is set (has been assigned a value) and false otherwise */
473
  public boolean isSetCustomerId() {
474
    return __isset_bit_vector.get(__CUSTOMERID_ISSET_ID);
475
  }
476
 
477
  public void setCustomerIdIsSet(boolean value) {
478
    __isset_bit_vector.set(__CUSTOMERID_ISSET_ID, value);
479
  }
480
 
481
  public long getCustomerEmailId() {
482
    return this.customerEmailId;
483
  }
484
 
485
  public void setCustomerEmailId(long customerEmailId) {
486
    this.customerEmailId = customerEmailId;
487
    setCustomerEmailIdIsSet(true);
488
  }
489
 
490
  public void unsetCustomerEmailId() {
491
    __isset_bit_vector.clear(__CUSTOMEREMAILID_ISSET_ID);
492
  }
493
 
494
  /** Returns true if field customerEmailId is set (has been assigned a value) and false otherwise */
495
  public boolean isSetCustomerEmailId() {
496
    return __isset_bit_vector.get(__CUSTOMEREMAILID_ISSET_ID);
497
  }
498
 
499
  public void setCustomerEmailIdIsSet(boolean value) {
500
    __isset_bit_vector.set(__CUSTOMEREMAILID_ISSET_ID, value);
501
  }
502
 
503
  public long getExpiryTimestamp() {
504
    return this.expiryTimestamp;
505
  }
506
 
507
  public void setExpiryTimestamp(long expiryTimestamp) {
508
    this.expiryTimestamp = expiryTimestamp;
509
    setExpiryTimestampIsSet(true);
510
  }
511
 
512
  public void unsetExpiryTimestamp() {
513
    __isset_bit_vector.clear(__EXPIRYTIMESTAMP_ISSET_ID);
514
  }
515
 
516
  /** Returns true if field expiryTimestamp is set (has been assigned a value) and false otherwise */
517
  public boolean isSetExpiryTimestamp() {
518
    return __isset_bit_vector.get(__EXPIRYTIMESTAMP_ISSET_ID);
519
  }
520
 
521
  public void setExpiryTimestampIsSet(boolean value) {
522
    __isset_bit_vector.set(__EXPIRYTIMESTAMP_ISSET_ID, value);
523
  }
524
 
525
  public void setFieldValue(_Fields field, Object value) {
526
    switch (field) {
527
    case ID:
528
      if (value == null) {
529
        unsetId();
530
      } else {
531
        setId((Long)value);
532
      }
533
      break;
534
 
535
    case AMOUNT:
536
      if (value == null) {
537
        unsetAmount();
538
      } else {
539
        setAmount((Long)value);
540
      }
541
      break;
542
 
543
    case CREATING_TRANSACTION_ID:
544
      if (value == null) {
545
        unsetCreatingTransactionId();
546
      } else {
547
        setCreatingTransactionId((Long)value);
548
      }
549
      break;
550
 
551
    case CONSUMING_TRANSACTION_ID:
552
      if (value == null) {
553
        unsetConsumingTransactionId();
554
      } else {
555
        setConsumingTransactionId((Long)value);
556
      }
557
      break;
558
 
559
    case STATUS:
560
      if (value == null) {
561
        unsetStatus();
562
      } else {
563
        setStatus((RechargeCouponStatus)value);
564
      }
565
      break;
566
 
567
    case COUPON_CODE:
568
      if (value == null) {
569
        unsetCouponCode();
570
      } else {
571
        setCouponCode((String)value);
572
      }
573
      break;
574
 
575
    case CREATION_TIMESTAMP:
576
      if (value == null) {
577
        unsetCreationTimestamp();
578
      } else {
579
        setCreationTimestamp((Long)value);
580
      }
581
      break;
582
 
583
    case CONSUMED_TIMESTAMP:
584
      if (value == null) {
585
        unsetConsumedTimestamp();
586
      } else {
587
        setConsumedTimestamp((Long)value);
588
      }
589
      break;
590
 
591
    case CUSTOMER_ID:
592
      if (value == null) {
593
        unsetCustomerId();
594
      } else {
595
        setCustomerId((Long)value);
596
      }
597
      break;
598
 
599
    case CUSTOMER_EMAIL_ID:
600
      if (value == null) {
601
        unsetCustomerEmailId();
602
      } else {
603
        setCustomerEmailId((Long)value);
604
      }
605
      break;
606
 
607
    case EXPIRY_TIMESTAMP:
608
      if (value == null) {
609
        unsetExpiryTimestamp();
610
      } else {
611
        setExpiryTimestamp((Long)value);
612
      }
613
      break;
614
 
615
    }
616
  }
617
 
618
  public Object getFieldValue(_Fields field) {
619
    switch (field) {
620
    case ID:
621
      return Long.valueOf(getId());
622
 
623
    case AMOUNT:
624
      return Long.valueOf(getAmount());
625
 
626
    case CREATING_TRANSACTION_ID:
627
      return Long.valueOf(getCreatingTransactionId());
628
 
629
    case CONSUMING_TRANSACTION_ID:
630
      return Long.valueOf(getConsumingTransactionId());
631
 
632
    case STATUS:
633
      return getStatus();
634
 
635
    case COUPON_CODE:
636
      return getCouponCode();
637
 
638
    case CREATION_TIMESTAMP:
639
      return Long.valueOf(getCreationTimestamp());
640
 
641
    case CONSUMED_TIMESTAMP:
642
      return Long.valueOf(getConsumedTimestamp());
643
 
644
    case CUSTOMER_ID:
645
      return Long.valueOf(getCustomerId());
646
 
647
    case CUSTOMER_EMAIL_ID:
648
      return Long.valueOf(getCustomerEmailId());
649
 
650
    case EXPIRY_TIMESTAMP:
651
      return Long.valueOf(getExpiryTimestamp());
652
 
653
    }
654
    throw new IllegalStateException();
655
  }
656
 
657
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
658
  public boolean isSet(_Fields field) {
659
    if (field == null) {
660
      throw new IllegalArgumentException();
661
    }
662
 
663
    switch (field) {
664
    case ID:
665
      return isSetId();
666
    case AMOUNT:
667
      return isSetAmount();
668
    case CREATING_TRANSACTION_ID:
669
      return isSetCreatingTransactionId();
670
    case CONSUMING_TRANSACTION_ID:
671
      return isSetConsumingTransactionId();
672
    case STATUS:
673
      return isSetStatus();
674
    case COUPON_CODE:
675
      return isSetCouponCode();
676
    case CREATION_TIMESTAMP:
677
      return isSetCreationTimestamp();
678
    case CONSUMED_TIMESTAMP:
679
      return isSetConsumedTimestamp();
680
    case CUSTOMER_ID:
681
      return isSetCustomerId();
682
    case CUSTOMER_EMAIL_ID:
683
      return isSetCustomerEmailId();
684
    case EXPIRY_TIMESTAMP:
685
      return isSetExpiryTimestamp();
686
    }
687
    throw new IllegalStateException();
688
  }
689
 
690
  @Override
691
  public boolean equals(Object that) {
692
    if (that == null)
693
      return false;
694
    if (that instanceof RechargeCoupon)
695
      return this.equals((RechargeCoupon)that);
696
    return false;
697
  }
698
 
699
  public boolean equals(RechargeCoupon that) {
700
    if (that == null)
701
      return false;
702
 
703
    boolean this_present_id = true;
704
    boolean that_present_id = true;
705
    if (this_present_id || that_present_id) {
706
      if (!(this_present_id && that_present_id))
707
        return false;
708
      if (this.id != that.id)
709
        return false;
710
    }
711
 
712
    boolean this_present_amount = true;
713
    boolean that_present_amount = true;
714
    if (this_present_amount || that_present_amount) {
715
      if (!(this_present_amount && that_present_amount))
716
        return false;
717
      if (this.amount != that.amount)
718
        return false;
719
    }
720
 
721
    boolean this_present_creatingTransactionId = true;
722
    boolean that_present_creatingTransactionId = true;
723
    if (this_present_creatingTransactionId || that_present_creatingTransactionId) {
724
      if (!(this_present_creatingTransactionId && that_present_creatingTransactionId))
725
        return false;
726
      if (this.creatingTransactionId != that.creatingTransactionId)
727
        return false;
728
    }
729
 
730
    boolean this_present_consumingTransactionId = true;
731
    boolean that_present_consumingTransactionId = true;
732
    if (this_present_consumingTransactionId || that_present_consumingTransactionId) {
733
      if (!(this_present_consumingTransactionId && that_present_consumingTransactionId))
734
        return false;
735
      if (this.consumingTransactionId != that.consumingTransactionId)
736
        return false;
737
    }
738
 
739
    boolean this_present_status = true && this.isSetStatus();
740
    boolean that_present_status = true && that.isSetStatus();
741
    if (this_present_status || that_present_status) {
742
      if (!(this_present_status && that_present_status))
743
        return false;
744
      if (!this.status.equals(that.status))
745
        return false;
746
    }
747
 
748
    boolean this_present_couponCode = true && this.isSetCouponCode();
749
    boolean that_present_couponCode = true && that.isSetCouponCode();
750
    if (this_present_couponCode || that_present_couponCode) {
751
      if (!(this_present_couponCode && that_present_couponCode))
752
        return false;
753
      if (!this.couponCode.equals(that.couponCode))
754
        return false;
755
    }
756
 
757
    boolean this_present_creationTimestamp = true;
758
    boolean that_present_creationTimestamp = true;
759
    if (this_present_creationTimestamp || that_present_creationTimestamp) {
760
      if (!(this_present_creationTimestamp && that_present_creationTimestamp))
761
        return false;
762
      if (this.creationTimestamp != that.creationTimestamp)
763
        return false;
764
    }
765
 
766
    boolean this_present_consumedTimestamp = true;
767
    boolean that_present_consumedTimestamp = true;
768
    if (this_present_consumedTimestamp || that_present_consumedTimestamp) {
769
      if (!(this_present_consumedTimestamp && that_present_consumedTimestamp))
770
        return false;
771
      if (this.consumedTimestamp != that.consumedTimestamp)
772
        return false;
773
    }
774
 
775
    boolean this_present_customerId = true;
776
    boolean that_present_customerId = true;
777
    if (this_present_customerId || that_present_customerId) {
778
      if (!(this_present_customerId && that_present_customerId))
779
        return false;
780
      if (this.customerId != that.customerId)
781
        return false;
782
    }
783
 
784
    boolean this_present_customerEmailId = true;
785
    boolean that_present_customerEmailId = true;
786
    if (this_present_customerEmailId || that_present_customerEmailId) {
787
      if (!(this_present_customerEmailId && that_present_customerEmailId))
788
        return false;
789
      if (this.customerEmailId != that.customerEmailId)
790
        return false;
791
    }
792
 
793
    boolean this_present_expiryTimestamp = true;
794
    boolean that_present_expiryTimestamp = true;
795
    if (this_present_expiryTimestamp || that_present_expiryTimestamp) {
796
      if (!(this_present_expiryTimestamp && that_present_expiryTimestamp))
797
        return false;
798
      if (this.expiryTimestamp != that.expiryTimestamp)
799
        return false;
800
    }
801
 
802
    return true;
803
  }
804
 
805
  @Override
806
  public int hashCode() {
807
    return 0;
808
  }
809
 
810
  public int compareTo(RechargeCoupon other) {
811
    if (!getClass().equals(other.getClass())) {
812
      return getClass().getName().compareTo(other.getClass().getName());
813
    }
814
 
815
    int lastComparison = 0;
816
    RechargeCoupon typedOther = (RechargeCoupon)other;
817
 
818
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
819
    if (lastComparison != 0) {
820
      return lastComparison;
821
    }
822
    if (isSetId()) {
823
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
824
      if (lastComparison != 0) {
825
        return lastComparison;
826
      }
827
    }
828
    lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
829
    if (lastComparison != 0) {
830
      return lastComparison;
831
    }
832
    if (isSetAmount()) {
833
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
834
      if (lastComparison != 0) {
835
        return lastComparison;
836
      }
837
    }
838
    lastComparison = Boolean.valueOf(isSetCreatingTransactionId()).compareTo(typedOther.isSetCreatingTransactionId());
839
    if (lastComparison != 0) {
840
      return lastComparison;
841
    }
842
    if (isSetCreatingTransactionId()) {
843
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creatingTransactionId, typedOther.creatingTransactionId);
844
      if (lastComparison != 0) {
845
        return lastComparison;
846
      }
847
    }
848
    lastComparison = Boolean.valueOf(isSetConsumingTransactionId()).compareTo(typedOther.isSetConsumingTransactionId());
849
    if (lastComparison != 0) {
850
      return lastComparison;
851
    }
852
    if (isSetConsumingTransactionId()) {
853
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consumingTransactionId, typedOther.consumingTransactionId);
854
      if (lastComparison != 0) {
855
        return lastComparison;
856
      }
857
    }
858
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
859
    if (lastComparison != 0) {
860
      return lastComparison;
861
    }
862
    if (isSetStatus()) {
863
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
864
      if (lastComparison != 0) {
865
        return lastComparison;
866
      }
867
    }
868
    lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
869
    if (lastComparison != 0) {
870
      return lastComparison;
871
    }
872
    if (isSetCouponCode()) {
873
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
874
      if (lastComparison != 0) {
875
        return lastComparison;
876
      }
877
    }
878
    lastComparison = Boolean.valueOf(isSetCreationTimestamp()).compareTo(typedOther.isSetCreationTimestamp());
879
    if (lastComparison != 0) {
880
      return lastComparison;
881
    }
882
    if (isSetCreationTimestamp()) {
883
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creationTimestamp, typedOther.creationTimestamp);
884
      if (lastComparison != 0) {
885
        return lastComparison;
886
      }
887
    }
888
    lastComparison = Boolean.valueOf(isSetConsumedTimestamp()).compareTo(typedOther.isSetConsumedTimestamp());
889
    if (lastComparison != 0) {
890
      return lastComparison;
891
    }
892
    if (isSetConsumedTimestamp()) {
893
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.consumedTimestamp, typedOther.consumedTimestamp);
894
      if (lastComparison != 0) {
895
        return lastComparison;
896
      }
897
    }
898
    lastComparison = Boolean.valueOf(isSetCustomerId()).compareTo(typedOther.isSetCustomerId());
899
    if (lastComparison != 0) {
900
      return lastComparison;
901
    }
902
    if (isSetCustomerId()) {
903
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerId, typedOther.customerId);
904
      if (lastComparison != 0) {
905
        return lastComparison;
906
      }
907
    }
908
    lastComparison = Boolean.valueOf(isSetCustomerEmailId()).compareTo(typedOther.isSetCustomerEmailId());
909
    if (lastComparison != 0) {
910
      return lastComparison;
911
    }
912
    if (isSetCustomerEmailId()) {
913
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.customerEmailId, typedOther.customerEmailId);
914
      if (lastComparison != 0) {
915
        return lastComparison;
916
      }
917
    }
918
    lastComparison = Boolean.valueOf(isSetExpiryTimestamp()).compareTo(typedOther.isSetExpiryTimestamp());
919
    if (lastComparison != 0) {
920
      return lastComparison;
921
    }
922
    if (isSetExpiryTimestamp()) {
923
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.expiryTimestamp, typedOther.expiryTimestamp);
924
      if (lastComparison != 0) {
925
        return lastComparison;
926
      }
927
    }
928
    return 0;
929
  }
930
 
931
  public _Fields fieldForId(int fieldId) {
932
    return _Fields.findByThriftId(fieldId);
933
  }
934
 
935
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
936
    org.apache.thrift.protocol.TField field;
937
    iprot.readStructBegin();
938
    while (true)
939
    {
940
      field = iprot.readFieldBegin();
941
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
942
        break;
943
      }
944
      switch (field.id) {
945
        case 1: // ID
946
          if (field.type == org.apache.thrift.protocol.TType.I64) {
947
            this.id = iprot.readI64();
948
            setIdIsSet(true);
949
          } else { 
950
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
951
          }
952
          break;
953
        case 2: // AMOUNT
954
          if (field.type == org.apache.thrift.protocol.TType.I64) {
955
            this.amount = iprot.readI64();
956
            setAmountIsSet(true);
957
          } else { 
958
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
959
          }
960
          break;
961
        case 3: // CREATING_TRANSACTION_ID
962
          if (field.type == org.apache.thrift.protocol.TType.I64) {
963
            this.creatingTransactionId = iprot.readI64();
964
            setCreatingTransactionIdIsSet(true);
965
          } else { 
966
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
967
          }
968
          break;
969
        case 4: // CONSUMING_TRANSACTION_ID
970
          if (field.type == org.apache.thrift.protocol.TType.I64) {
971
            this.consumingTransactionId = iprot.readI64();
972
            setConsumingTransactionIdIsSet(true);
973
          } else { 
974
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
975
          }
976
          break;
977
        case 5: // STATUS
978
          if (field.type == org.apache.thrift.protocol.TType.I32) {
979
            this.status = RechargeCouponStatus.findByValue(iprot.readI32());
980
          } else { 
981
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
982
          }
983
          break;
984
        case 6: // COUPON_CODE
985
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
986
            this.couponCode = iprot.readString();
987
          } else { 
988
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
989
          }
990
          break;
991
        case 7: // CREATION_TIMESTAMP
992
          if (field.type == org.apache.thrift.protocol.TType.I64) {
993
            this.creationTimestamp = iprot.readI64();
994
            setCreationTimestampIsSet(true);
995
          } else { 
996
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
997
          }
998
          break;
999
        case 8: // CONSUMED_TIMESTAMP
1000
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1001
            this.consumedTimestamp = iprot.readI64();
1002
            setConsumedTimestampIsSet(true);
1003
          } else { 
1004
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1005
          }
1006
          break;
1007
        case 9: // CUSTOMER_ID
1008
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1009
            this.customerId = iprot.readI64();
1010
            setCustomerIdIsSet(true);
1011
          } else { 
1012
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1013
          }
1014
          break;
1015
        case 10: // CUSTOMER_EMAIL_ID
1016
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1017
            this.customerEmailId = iprot.readI64();
1018
            setCustomerEmailIdIsSet(true);
1019
          } else { 
1020
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1021
          }
1022
          break;
1023
        case 11: // EXPIRY_TIMESTAMP
1024
          if (field.type == org.apache.thrift.protocol.TType.I64) {
1025
            this.expiryTimestamp = iprot.readI64();
1026
            setExpiryTimestampIsSet(true);
1027
          } else { 
1028
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1029
          }
1030
          break;
1031
        default:
1032
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1033
      }
1034
      iprot.readFieldEnd();
1035
    }
1036
    iprot.readStructEnd();
1037
    validate();
1038
  }
1039
 
1040
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1041
    validate();
1042
 
1043
    oprot.writeStructBegin(STRUCT_DESC);
1044
    oprot.writeFieldBegin(ID_FIELD_DESC);
1045
    oprot.writeI64(this.id);
1046
    oprot.writeFieldEnd();
1047
    oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
1048
    oprot.writeI64(this.amount);
1049
    oprot.writeFieldEnd();
1050
    oprot.writeFieldBegin(CREATING_TRANSACTION_ID_FIELD_DESC);
1051
    oprot.writeI64(this.creatingTransactionId);
1052
    oprot.writeFieldEnd();
1053
    oprot.writeFieldBegin(CONSUMING_TRANSACTION_ID_FIELD_DESC);
1054
    oprot.writeI64(this.consumingTransactionId);
1055
    oprot.writeFieldEnd();
1056
    if (this.status != null) {
1057
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
1058
      oprot.writeI32(this.status.getValue());
1059
      oprot.writeFieldEnd();
1060
    }
1061
    if (this.couponCode != null) {
1062
      oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
1063
      oprot.writeString(this.couponCode);
1064
      oprot.writeFieldEnd();
1065
    }
1066
    oprot.writeFieldBegin(CREATION_TIMESTAMP_FIELD_DESC);
1067
    oprot.writeI64(this.creationTimestamp);
1068
    oprot.writeFieldEnd();
1069
    oprot.writeFieldBegin(CONSUMED_TIMESTAMP_FIELD_DESC);
1070
    oprot.writeI64(this.consumedTimestamp);
1071
    oprot.writeFieldEnd();
1072
    oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
1073
    oprot.writeI64(this.customerId);
1074
    oprot.writeFieldEnd();
1075
    oprot.writeFieldBegin(CUSTOMER_EMAIL_ID_FIELD_DESC);
1076
    oprot.writeI64(this.customerEmailId);
1077
    oprot.writeFieldEnd();
1078
    oprot.writeFieldBegin(EXPIRY_TIMESTAMP_FIELD_DESC);
1079
    oprot.writeI64(this.expiryTimestamp);
1080
    oprot.writeFieldEnd();
1081
    oprot.writeFieldStop();
1082
    oprot.writeStructEnd();
1083
  }
1084
 
1085
  @Override
1086
  public String toString() {
1087
    StringBuilder sb = new StringBuilder("RechargeCoupon(");
1088
    boolean first = true;
1089
 
1090
    sb.append("id:");
1091
    sb.append(this.id);
1092
    first = false;
1093
    if (!first) sb.append(", ");
1094
    sb.append("amount:");
1095
    sb.append(this.amount);
1096
    first = false;
1097
    if (!first) sb.append(", ");
1098
    sb.append("creatingTransactionId:");
1099
    sb.append(this.creatingTransactionId);
1100
    first = false;
1101
    if (!first) sb.append(", ");
1102
    sb.append("consumingTransactionId:");
1103
    sb.append(this.consumingTransactionId);
1104
    first = false;
1105
    if (!first) sb.append(", ");
1106
    sb.append("status:");
1107
    if (this.status == null) {
1108
      sb.append("null");
1109
    } else {
1110
      sb.append(this.status);
1111
    }
1112
    first = false;
1113
    if (!first) sb.append(", ");
1114
    sb.append("couponCode:");
1115
    if (this.couponCode == null) {
1116
      sb.append("null");
1117
    } else {
1118
      sb.append(this.couponCode);
1119
    }
1120
    first = false;
1121
    if (!first) sb.append(", ");
1122
    sb.append("creationTimestamp:");
1123
    sb.append(this.creationTimestamp);
1124
    first = false;
1125
    if (!first) sb.append(", ");
1126
    sb.append("consumedTimestamp:");
1127
    sb.append(this.consumedTimestamp);
1128
    first = false;
1129
    if (!first) sb.append(", ");
1130
    sb.append("customerId:");
1131
    sb.append(this.customerId);
1132
    first = false;
1133
    if (!first) sb.append(", ");
1134
    sb.append("customerEmailId:");
1135
    sb.append(this.customerEmailId);
1136
    first = false;
1137
    if (!first) sb.append(", ");
1138
    sb.append("expiryTimestamp:");
1139
    sb.append(this.expiryTimestamp);
1140
    first = false;
1141
    sb.append(")");
1142
    return sb.toString();
1143
  }
1144
 
1145
  public void validate() throws org.apache.thrift.TException {
1146
    // check for required fields
1147
  }
1148
 
1149
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1150
    try {
1151
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1152
    } catch (org.apache.thrift.TException te) {
1153
      throw new java.io.IOException(te);
1154
    }
1155
  }
1156
 
1157
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1158
    try {
1159
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1160
      __isset_bit_vector = new BitSet(1);
1161
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1162
    } catch (org.apache.thrift.TException te) {
1163
      throw new java.io.IOException(te);
1164
    }
1165
  }
1166
 
1167
}
1168