Subversion Repositories SmartDukaan

Rev

Rev 22043 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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