Subversion Repositories SmartDukaan

Rev

Rev 18585 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18578 manish.sha 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 CreditHistory implements org.apache.thrift.TBase<CreditHistory, CreditHistory._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CreditHistory");
25
 
18634 manish.sha 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 USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("user_id", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField CREDITOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("creditor_id", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField PAYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("payment_id", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
31
  private static final org.apache.thrift.protocol.TField CREDIT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("credit_type", org.apache.thrift.protocol.TType.I32, (short)6);
32
  private static final org.apache.thrift.protocol.TField CREATED_FIELD_DESC = new org.apache.thrift.protocol.TField("created", org.apache.thrift.protocol.TType.I64, (short)7);
33
  private static final org.apache.thrift.protocol.TField SHIPPING_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("shipping_id", org.apache.thrift.protocol.TType.STRING, (short)8);
18578 manish.sha 34
 
18634 manish.sha 35
  private long id; // required
18578 manish.sha 36
  private long user_id; // required
37
  private long creditor_id; // required
38
  private long payment_id; // required
39
  private double amount; // required
18585 amit.gupta 40
  private CreditTxnType credit_type; // required
18578 manish.sha 41
  private long created; // required
42
  private String shipping_id; // required
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 {
18634 manish.sha 46
    ID((short)1, "id"),
47
    USER_ID((short)2, "user_id"),
48
    CREDITOR_ID((short)3, "creditor_id"),
49
    PAYMENT_ID((short)4, "payment_id"),
50
    AMOUNT((short)5, "amount"),
18578 manish.sha 51
    /**
52
     * 
53
     * @see CreditTxnType
54
     */
18634 manish.sha 55
    CREDIT_TYPE((short)6, "credit_type"),
56
    CREATED((short)7, "created"),
57
    SHIPPING_ID((short)8, "shipping_id");
18578 manish.sha 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) {
18634 manish.sha 72
        case 1: // ID
73
          return ID;
74
        case 2: // USER_ID
18578 manish.sha 75
          return USER_ID;
18634 manish.sha 76
        case 3: // CREDITOR_ID
18578 manish.sha 77
          return CREDITOR_ID;
18634 manish.sha 78
        case 4: // PAYMENT_ID
18578 manish.sha 79
          return PAYMENT_ID;
18634 manish.sha 80
        case 5: // AMOUNT
18578 manish.sha 81
          return AMOUNT;
18634 manish.sha 82
        case 6: // CREDIT_TYPE
18585 amit.gupta 83
          return CREDIT_TYPE;
18634 manish.sha 84
        case 7: // CREATED
18578 manish.sha 85
          return CREATED;
18634 manish.sha 86
        case 8: // SHIPPING_ID
18578 manish.sha 87
          return SHIPPING_ID;
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
18634 manish.sha 128
  private static final int __ID_ISSET_ID = 0;
129
  private static final int __USER_ID_ISSET_ID = 1;
130
  private static final int __CREDITOR_ID_ISSET_ID = 2;
131
  private static final int __PAYMENT_ID_ISSET_ID = 3;
132
  private static final int __AMOUNT_ISSET_ID = 4;
133
  private static final int __CREATED_ISSET_ID = 5;
134
  private BitSet __isset_bit_vector = new BitSet(6);
18578 manish.sha 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);
18634 manish.sha 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)));
18578 manish.sha 141
    tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("user_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
143
    tmpMap.put(_Fields.CREDITOR_ID, new org.apache.thrift.meta_data.FieldMetaData("creditor_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
145
    tmpMap.put(_Fields.PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("payment_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
147
    tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
18585 amit.gupta 149
    tmpMap.put(_Fields.CREDIT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("credit_type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18578 manish.sha 150
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CreditTxnType.class)));
151
    tmpMap.put(_Fields.CREATED, new org.apache.thrift.meta_data.FieldMetaData("created", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
153
    tmpMap.put(_Fields.SHIPPING_ID, new org.apache.thrift.meta_data.FieldMetaData("shipping_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
155
    metaDataMap = Collections.unmodifiableMap(tmpMap);
156
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CreditHistory.class, metaDataMap);
157
  }
158
 
159
  public CreditHistory() {
160
  }
161
 
162
  public CreditHistory(
18634 manish.sha 163
    long id,
18578 manish.sha 164
    long user_id,
165
    long creditor_id,
166
    long payment_id,
167
    double amount,
18585 amit.gupta 168
    CreditTxnType credit_type,
18578 manish.sha 169
    long created,
18634 manish.sha 170
    String shipping_id)
18578 manish.sha 171
  {
172
    this();
18634 manish.sha 173
    this.id = id;
174
    setIdIsSet(true);
18578 manish.sha 175
    this.user_id = user_id;
176
    setUser_idIsSet(true);
177
    this.creditor_id = creditor_id;
178
    setCreditor_idIsSet(true);
179
    this.payment_id = payment_id;
180
    setPayment_idIsSet(true);
181
    this.amount = amount;
182
    setAmountIsSet(true);
18585 amit.gupta 183
    this.credit_type = credit_type;
18578 manish.sha 184
    this.created = created;
185
    setCreatedIsSet(true);
186
    this.shipping_id = shipping_id;
187
  }
188
 
189
  /**
190
   * Performs a deep copy on <i>other</i>.
191
   */
192
  public CreditHistory(CreditHistory other) {
193
    __isset_bit_vector.clear();
194
    __isset_bit_vector.or(other.__isset_bit_vector);
18634 manish.sha 195
    this.id = other.id;
18578 manish.sha 196
    this.user_id = other.user_id;
197
    this.creditor_id = other.creditor_id;
198
    this.payment_id = other.payment_id;
199
    this.amount = other.amount;
18585 amit.gupta 200
    if (other.isSetCredit_type()) {
201
      this.credit_type = other.credit_type;
18578 manish.sha 202
    }
203
    this.created = other.created;
204
    if (other.isSetShipping_id()) {
205
      this.shipping_id = other.shipping_id;
206
    }
207
  }
208
 
209
  public CreditHistory deepCopy() {
210
    return new CreditHistory(this);
211
  }
212
 
213
  @Override
214
  public void clear() {
18634 manish.sha 215
    setIdIsSet(false);
216
    this.id = 0;
18578 manish.sha 217
    setUser_idIsSet(false);
218
    this.user_id = 0;
219
    setCreditor_idIsSet(false);
220
    this.creditor_id = 0;
221
    setPayment_idIsSet(false);
222
    this.payment_id = 0;
223
    setAmountIsSet(false);
224
    this.amount = 0.0;
18585 amit.gupta 225
    this.credit_type = null;
18578 manish.sha 226
    setCreatedIsSet(false);
227
    this.created = 0;
228
    this.shipping_id = null;
229
  }
230
 
18634 manish.sha 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
 
18578 manish.sha 253
  public long getUser_id() {
254
    return this.user_id;
255
  }
256
 
257
  public void setUser_id(long user_id) {
258
    this.user_id = user_id;
259
    setUser_idIsSet(true);
260
  }
261
 
262
  public void unsetUser_id() {
263
    __isset_bit_vector.clear(__USER_ID_ISSET_ID);
264
  }
265
 
266
  /** Returns true if field user_id is set (has been assigned a value) and false otherwise */
267
  public boolean isSetUser_id() {
268
    return __isset_bit_vector.get(__USER_ID_ISSET_ID);
269
  }
270
 
271
  public void setUser_idIsSet(boolean value) {
272
    __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
273
  }
274
 
275
  public long getCreditor_id() {
276
    return this.creditor_id;
277
  }
278
 
279
  public void setCreditor_id(long creditor_id) {
280
    this.creditor_id = creditor_id;
281
    setCreditor_idIsSet(true);
282
  }
283
 
284
  public void unsetCreditor_id() {
285
    __isset_bit_vector.clear(__CREDITOR_ID_ISSET_ID);
286
  }
287
 
288
  /** Returns true if field creditor_id is set (has been assigned a value) and false otherwise */
289
  public boolean isSetCreditor_id() {
290
    return __isset_bit_vector.get(__CREDITOR_ID_ISSET_ID);
291
  }
292
 
293
  public void setCreditor_idIsSet(boolean value) {
294
    __isset_bit_vector.set(__CREDITOR_ID_ISSET_ID, value);
295
  }
296
 
297
  public long getPayment_id() {
298
    return this.payment_id;
299
  }
300
 
301
  public void setPayment_id(long payment_id) {
302
    this.payment_id = payment_id;
303
    setPayment_idIsSet(true);
304
  }
305
 
306
  public void unsetPayment_id() {
307
    __isset_bit_vector.clear(__PAYMENT_ID_ISSET_ID);
308
  }
309
 
310
  /** Returns true if field payment_id is set (has been assigned a value) and false otherwise */
311
  public boolean isSetPayment_id() {
312
    return __isset_bit_vector.get(__PAYMENT_ID_ISSET_ID);
313
  }
314
 
315
  public void setPayment_idIsSet(boolean value) {
316
    __isset_bit_vector.set(__PAYMENT_ID_ISSET_ID, value);
317
  }
318
 
319
  public double getAmount() {
320
    return this.amount;
321
  }
322
 
323
  public void setAmount(double amount) {
324
    this.amount = amount;
325
    setAmountIsSet(true);
326
  }
327
 
328
  public void unsetAmount() {
329
    __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
330
  }
331
 
332
  /** Returns true if field amount is set (has been assigned a value) and false otherwise */
333
  public boolean isSetAmount() {
334
    return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
335
  }
336
 
337
  public void setAmountIsSet(boolean value) {
338
    __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
339
  }
340
 
341
  /**
342
   * 
343
   * @see CreditTxnType
344
   */
18585 amit.gupta 345
  public CreditTxnType getCredit_type() {
346
    return this.credit_type;
18578 manish.sha 347
  }
348
 
349
  /**
350
   * 
351
   * @see CreditTxnType
352
   */
18585 amit.gupta 353
  public void setCredit_type(CreditTxnType credit_type) {
354
    this.credit_type = credit_type;
18578 manish.sha 355
  }
356
 
18585 amit.gupta 357
  public void unsetCredit_type() {
358
    this.credit_type = null;
18578 manish.sha 359
  }
360
 
18585 amit.gupta 361
  /** Returns true if field credit_type is set (has been assigned a value) and false otherwise */
362
  public boolean isSetCredit_type() {
363
    return this.credit_type != null;
18578 manish.sha 364
  }
365
 
18585 amit.gupta 366
  public void setCredit_typeIsSet(boolean value) {
18578 manish.sha 367
    if (!value) {
18585 amit.gupta 368
      this.credit_type = null;
18578 manish.sha 369
    }
370
  }
371
 
372
  public long getCreated() {
373
    return this.created;
374
  }
375
 
376
  public void setCreated(long created) {
377
    this.created = created;
378
    setCreatedIsSet(true);
379
  }
380
 
381
  public void unsetCreated() {
382
    __isset_bit_vector.clear(__CREATED_ISSET_ID);
383
  }
384
 
385
  /** Returns true if field created is set (has been assigned a value) and false otherwise */
386
  public boolean isSetCreated() {
387
    return __isset_bit_vector.get(__CREATED_ISSET_ID);
388
  }
389
 
390
  public void setCreatedIsSet(boolean value) {
391
    __isset_bit_vector.set(__CREATED_ISSET_ID, value);
392
  }
393
 
394
  public String getShipping_id() {
395
    return this.shipping_id;
396
  }
397
 
398
  public void setShipping_id(String shipping_id) {
399
    this.shipping_id = shipping_id;
400
  }
401
 
402
  public void unsetShipping_id() {
403
    this.shipping_id = null;
404
  }
405
 
406
  /** Returns true if field shipping_id is set (has been assigned a value) and false otherwise */
407
  public boolean isSetShipping_id() {
408
    return this.shipping_id != null;
409
  }
410
 
411
  public void setShipping_idIsSet(boolean value) {
412
    if (!value) {
413
      this.shipping_id = null;
414
    }
415
  }
416
 
417
  public void setFieldValue(_Fields field, Object value) {
418
    switch (field) {
18634 manish.sha 419
    case ID:
420
      if (value == null) {
421
        unsetId();
422
      } else {
423
        setId((Long)value);
424
      }
425
      break;
426
 
18578 manish.sha 427
    case USER_ID:
428
      if (value == null) {
429
        unsetUser_id();
430
      } else {
431
        setUser_id((Long)value);
432
      }
433
      break;
434
 
435
    case CREDITOR_ID:
436
      if (value == null) {
437
        unsetCreditor_id();
438
      } else {
439
        setCreditor_id((Long)value);
440
      }
441
      break;
442
 
443
    case PAYMENT_ID:
444
      if (value == null) {
445
        unsetPayment_id();
446
      } else {
447
        setPayment_id((Long)value);
448
      }
449
      break;
450
 
451
    case AMOUNT:
452
      if (value == null) {
453
        unsetAmount();
454
      } else {
455
        setAmount((Double)value);
456
      }
457
      break;
458
 
18585 amit.gupta 459
    case CREDIT_TYPE:
18578 manish.sha 460
      if (value == null) {
18585 amit.gupta 461
        unsetCredit_type();
18578 manish.sha 462
      } else {
18585 amit.gupta 463
        setCredit_type((CreditTxnType)value);
18578 manish.sha 464
      }
465
      break;
466
 
467
    case CREATED:
468
      if (value == null) {
469
        unsetCreated();
470
      } else {
471
        setCreated((Long)value);
472
      }
473
      break;
474
 
475
    case SHIPPING_ID:
476
      if (value == null) {
477
        unsetShipping_id();
478
      } else {
479
        setShipping_id((String)value);
480
      }
481
      break;
482
 
483
    }
484
  }
485
 
486
  public Object getFieldValue(_Fields field) {
487
    switch (field) {
18634 manish.sha 488
    case ID:
489
      return Long.valueOf(getId());
490
 
18578 manish.sha 491
    case USER_ID:
492
      return Long.valueOf(getUser_id());
493
 
494
    case CREDITOR_ID:
495
      return Long.valueOf(getCreditor_id());
496
 
497
    case PAYMENT_ID:
498
      return Long.valueOf(getPayment_id());
499
 
500
    case AMOUNT:
501
      return Double.valueOf(getAmount());
502
 
18585 amit.gupta 503
    case CREDIT_TYPE:
504
      return getCredit_type();
18578 manish.sha 505
 
506
    case CREATED:
507
      return Long.valueOf(getCreated());
508
 
509
    case SHIPPING_ID:
510
      return getShipping_id();
511
 
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) {
18634 manish.sha 523
    case ID:
524
      return isSetId();
18578 manish.sha 525
    case USER_ID:
526
      return isSetUser_id();
527
    case CREDITOR_ID:
528
      return isSetCreditor_id();
529
    case PAYMENT_ID:
530
      return isSetPayment_id();
531
    case AMOUNT:
532
      return isSetAmount();
18585 amit.gupta 533
    case CREDIT_TYPE:
534
      return isSetCredit_type();
18578 manish.sha 535
    case CREATED:
536
      return isSetCreated();
537
    case SHIPPING_ID:
538
      return isSetShipping_id();
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 CreditHistory)
548
      return this.equals((CreditHistory)that);
549
    return false;
550
  }
551
 
552
  public boolean equals(CreditHistory that) {
553
    if (that == null)
554
      return false;
555
 
18634 manish.sha 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
 
18578 manish.sha 565
    boolean this_present_user_id = true;
566
    boolean that_present_user_id = true;
567
    if (this_present_user_id || that_present_user_id) {
568
      if (!(this_present_user_id && that_present_user_id))
569
        return false;
570
      if (this.user_id != that.user_id)
571
        return false;
572
    }
573
 
574
    boolean this_present_creditor_id = true;
575
    boolean that_present_creditor_id = true;
576
    if (this_present_creditor_id || that_present_creditor_id) {
577
      if (!(this_present_creditor_id && that_present_creditor_id))
578
        return false;
579
      if (this.creditor_id != that.creditor_id)
580
        return false;
581
    }
582
 
583
    boolean this_present_payment_id = true;
584
    boolean that_present_payment_id = true;
585
    if (this_present_payment_id || that_present_payment_id) {
586
      if (!(this_present_payment_id && that_present_payment_id))
587
        return false;
588
      if (this.payment_id != that.payment_id)
589
        return false;
590
    }
591
 
592
    boolean this_present_amount = true;
593
    boolean that_present_amount = true;
594
    if (this_present_amount || that_present_amount) {
595
      if (!(this_present_amount && that_present_amount))
596
        return false;
597
      if (this.amount != that.amount)
598
        return false;
599
    }
600
 
18585 amit.gupta 601
    boolean this_present_credit_type = true && this.isSetCredit_type();
602
    boolean that_present_credit_type = true && that.isSetCredit_type();
603
    if (this_present_credit_type || that_present_credit_type) {
604
      if (!(this_present_credit_type && that_present_credit_type))
18578 manish.sha 605
        return false;
18585 amit.gupta 606
      if (!this.credit_type.equals(that.credit_type))
18578 manish.sha 607
        return false;
608
    }
609
 
610
    boolean this_present_created = true;
611
    boolean that_present_created = true;
612
    if (this_present_created || that_present_created) {
613
      if (!(this_present_created && that_present_created))
614
        return false;
615
      if (this.created != that.created)
616
        return false;
617
    }
618
 
619
    boolean this_present_shipping_id = true && this.isSetShipping_id();
620
    boolean that_present_shipping_id = true && that.isSetShipping_id();
621
    if (this_present_shipping_id || that_present_shipping_id) {
622
      if (!(this_present_shipping_id && that_present_shipping_id))
623
        return false;
624
      if (!this.shipping_id.equals(that.shipping_id))
625
        return false;
626
    }
627
 
628
    return true;
629
  }
630
 
631
  @Override
632
  public int hashCode() {
633
    return 0;
634
  }
635
 
636
  public int compareTo(CreditHistory other) {
637
    if (!getClass().equals(other.getClass())) {
638
      return getClass().getName().compareTo(other.getClass().getName());
639
    }
640
 
641
    int lastComparison = 0;
642
    CreditHistory typedOther = (CreditHistory)other;
643
 
18634 manish.sha 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
    }
18578 manish.sha 654
    lastComparison = Boolean.valueOf(isSetUser_id()).compareTo(typedOther.isSetUser_id());
655
    if (lastComparison != 0) {
656
      return lastComparison;
657
    }
658
    if (isSetUser_id()) {
659
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user_id, typedOther.user_id);
660
      if (lastComparison != 0) {
661
        return lastComparison;
662
      }
663
    }
664
    lastComparison = Boolean.valueOf(isSetCreditor_id()).compareTo(typedOther.isSetCreditor_id());
665
    if (lastComparison != 0) {
666
      return lastComparison;
667
    }
668
    if (isSetCreditor_id()) {
669
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creditor_id, typedOther.creditor_id);
670
      if (lastComparison != 0) {
671
        return lastComparison;
672
      }
673
    }
674
    lastComparison = Boolean.valueOf(isSetPayment_id()).compareTo(typedOther.isSetPayment_id());
675
    if (lastComparison != 0) {
676
      return lastComparison;
677
    }
678
    if (isSetPayment_id()) {
679
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payment_id, typedOther.payment_id);
680
      if (lastComparison != 0) {
681
        return lastComparison;
682
      }
683
    }
684
    lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
685
    if (lastComparison != 0) {
686
      return lastComparison;
687
    }
688
    if (isSetAmount()) {
689
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
690
      if (lastComparison != 0) {
691
        return lastComparison;
692
      }
693
    }
18585 amit.gupta 694
    lastComparison = Boolean.valueOf(isSetCredit_type()).compareTo(typedOther.isSetCredit_type());
18578 manish.sha 695
    if (lastComparison != 0) {
696
      return lastComparison;
697
    }
18585 amit.gupta 698
    if (isSetCredit_type()) {
699
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credit_type, typedOther.credit_type);
18578 manish.sha 700
      if (lastComparison != 0) {
701
        return lastComparison;
702
      }
703
    }
704
    lastComparison = Boolean.valueOf(isSetCreated()).compareTo(typedOther.isSetCreated());
705
    if (lastComparison != 0) {
706
      return lastComparison;
707
    }
708
    if (isSetCreated()) {
709
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.created, typedOther.created);
710
      if (lastComparison != 0) {
711
        return lastComparison;
712
      }
713
    }
714
    lastComparison = Boolean.valueOf(isSetShipping_id()).compareTo(typedOther.isSetShipping_id());
715
    if (lastComparison != 0) {
716
      return lastComparison;
717
    }
718
    if (isSetShipping_id()) {
719
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shipping_id, typedOther.shipping_id);
720
      if (lastComparison != 0) {
721
        return lastComparison;
722
      }
723
    }
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) {
18634 manish.sha 741
        case 1: // ID
18578 manish.sha 742
          if (field.type == org.apache.thrift.protocol.TType.I64) {
18634 manish.sha 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: // USER_ID
750
          if (field.type == org.apache.thrift.protocol.TType.I64) {
18578 manish.sha 751
            this.user_id = iprot.readI64();
752
            setUser_idIsSet(true);
753
          } else { 
754
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
755
          }
756
          break;
18634 manish.sha 757
        case 3: // CREDITOR_ID
18578 manish.sha 758
          if (field.type == org.apache.thrift.protocol.TType.I64) {
759
            this.creditor_id = iprot.readI64();
760
            setCreditor_idIsSet(true);
761
          } else { 
762
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
763
          }
764
          break;
18634 manish.sha 765
        case 4: // PAYMENT_ID
18578 manish.sha 766
          if (field.type == org.apache.thrift.protocol.TType.I64) {
767
            this.payment_id = iprot.readI64();
768
            setPayment_idIsSet(true);
769
          } else { 
770
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
771
          }
772
          break;
18634 manish.sha 773
        case 5: // AMOUNT
18578 manish.sha 774
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
775
            this.amount = iprot.readDouble();
776
            setAmountIsSet(true);
777
          } else { 
778
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
779
          }
780
          break;
18634 manish.sha 781
        case 6: // CREDIT_TYPE
18578 manish.sha 782
          if (field.type == org.apache.thrift.protocol.TType.I32) {
18585 amit.gupta 783
            this.credit_type = CreditTxnType.findByValue(iprot.readI32());
18578 manish.sha 784
          } else { 
785
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
786
          }
787
          break;
18634 manish.sha 788
        case 7: // CREATED
18578 manish.sha 789
          if (field.type == org.apache.thrift.protocol.TType.I64) {
790
            this.created = iprot.readI64();
791
            setCreatedIsSet(true);
792
          } else { 
793
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
794
          }
795
          break;
18634 manish.sha 796
        case 8: // SHIPPING_ID
18578 manish.sha 797
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
798
            this.shipping_id = iprot.readString();
799
          } else { 
800
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
801
          }
802
          break;
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);
18634 manish.sha 816
    oprot.writeFieldBegin(ID_FIELD_DESC);
817
    oprot.writeI64(this.id);
818
    oprot.writeFieldEnd();
18578 manish.sha 819
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
820
    oprot.writeI64(this.user_id);
821
    oprot.writeFieldEnd();
822
    oprot.writeFieldBegin(CREDITOR_ID_FIELD_DESC);
823
    oprot.writeI64(this.creditor_id);
824
    oprot.writeFieldEnd();
825
    oprot.writeFieldBegin(PAYMENT_ID_FIELD_DESC);
826
    oprot.writeI64(this.payment_id);
827
    oprot.writeFieldEnd();
828
    oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
829
    oprot.writeDouble(this.amount);
830
    oprot.writeFieldEnd();
18585 amit.gupta 831
    if (this.credit_type != null) {
832
      oprot.writeFieldBegin(CREDIT_TYPE_FIELD_DESC);
833
      oprot.writeI32(this.credit_type.getValue());
18578 manish.sha 834
      oprot.writeFieldEnd();
835
    }
836
    oprot.writeFieldBegin(CREATED_FIELD_DESC);
837
    oprot.writeI64(this.created);
838
    oprot.writeFieldEnd();
839
    if (this.shipping_id != null) {
840
      oprot.writeFieldBegin(SHIPPING_ID_FIELD_DESC);
841
      oprot.writeString(this.shipping_id);
842
      oprot.writeFieldEnd();
843
    }
844
    oprot.writeFieldStop();
845
    oprot.writeStructEnd();
846
  }
847
 
848
  @Override
849
  public String toString() {
850
    StringBuilder sb = new StringBuilder("CreditHistory(");
851
    boolean first = true;
852
 
18634 manish.sha 853
    sb.append("id:");
854
    sb.append(this.id);
855
    first = false;
856
    if (!first) sb.append(", ");
18578 manish.sha 857
    sb.append("user_id:");
858
    sb.append(this.user_id);
859
    first = false;
860
    if (!first) sb.append(", ");
861
    sb.append("creditor_id:");
862
    sb.append(this.creditor_id);
863
    first = false;
864
    if (!first) sb.append(", ");
865
    sb.append("payment_id:");
866
    sb.append(this.payment_id);
867
    first = false;
868
    if (!first) sb.append(", ");
869
    sb.append("amount:");
870
    sb.append(this.amount);
871
    first = false;
872
    if (!first) sb.append(", ");
18585 amit.gupta 873
    sb.append("credit_type:");
874
    if (this.credit_type == null) {
18578 manish.sha 875
      sb.append("null");
876
    } else {
18585 amit.gupta 877
      sb.append(this.credit_type);
18578 manish.sha 878
    }
879
    first = false;
880
    if (!first) sb.append(", ");
881
    sb.append("created:");
882
    sb.append(this.created);
883
    first = false;
884
    if (!first) sb.append(", ");
885
    sb.append("shipping_id:");
886
    if (this.shipping_id == null) {
887
      sb.append("null");
888
    } else {
889
      sb.append(this.shipping_id);
890
    }
891
    first = false;
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