Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
18577 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.payments;
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
 
26
  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)1);
27
  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)2);
28
  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)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.DOUBLE, (short)4);
30
  private static final org.apache.thrift.protocol.TField CREDITTYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("credittype", org.apache.thrift.protocol.TType.I32, (short)5);
31
  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)6);
32
  private static final org.apache.thrift.protocol.TField UPDATED_FIELD_DESC = new org.apache.thrift.protocol.TField("updated", org.apache.thrift.protocol.TType.I64, (short)7);
33
  private static final org.apache.thrift.protocol.TField LOAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("loan_id", org.apache.thrift.protocol.TType.STRING, (short)8);
34
  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)9);
35
  private static final org.apache.thrift.protocol.TField DUE_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("dueDate", org.apache.thrift.protocol.TType.I64, (short)10);
36
 
37
  private long user_id; // required
38
  private long creditor_id; // required
39
  private long payment_id; // required
40
  private double amount; // required
41
  private CreditTxnType credittype; // required
42
  private long created; // required
43
  private long updated; // required
44
  private String loan_id; // required
45
  private String shipping_id; // required
46
  private long dueDate; // required
47
 
48
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
49
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
50
    USER_ID((short)1, "user_id"),
51
    CREDITOR_ID((short)2, "creditor_id"),
52
    PAYMENT_ID((short)3, "payment_id"),
53
    AMOUNT((short)4, "amount"),
54
    /**
55
     * 
56
     * @see CreditTxnType
57
     */
58
    CREDITTYPE((short)5, "credittype"),
59
    CREATED((short)6, "created"),
60
    UPDATED((short)7, "updated"),
61
    LOAN_ID((short)8, "loan_id"),
62
    SHIPPING_ID((short)9, "shipping_id"),
63
    DUE_DATE((short)10, "dueDate");
64
 
65
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
66
 
67
    static {
68
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
69
        byName.put(field.getFieldName(), field);
70
      }
71
    }
72
 
73
    /**
74
     * Find the _Fields constant that matches fieldId, or null if its not found.
75
     */
76
    public static _Fields findByThriftId(int fieldId) {
77
      switch(fieldId) {
78
        case 1: // USER_ID
79
          return USER_ID;
80
        case 2: // CREDITOR_ID
81
          return CREDITOR_ID;
82
        case 3: // PAYMENT_ID
83
          return PAYMENT_ID;
84
        case 4: // AMOUNT
85
          return AMOUNT;
86
        case 5: // CREDITTYPE
87
          return CREDITTYPE;
88
        case 6: // CREATED
89
          return CREATED;
90
        case 7: // UPDATED
91
          return UPDATED;
92
        case 8: // LOAN_ID
93
          return LOAN_ID;
94
        case 9: // SHIPPING_ID
95
          return SHIPPING_ID;
96
        case 10: // DUE_DATE
97
          return DUE_DATE;
98
        default:
99
          return null;
100
      }
101
    }
102
 
103
    /**
104
     * Find the _Fields constant that matches fieldId, throwing an exception
105
     * if it is not found.
106
     */
107
    public static _Fields findByThriftIdOrThrow(int fieldId) {
108
      _Fields fields = findByThriftId(fieldId);
109
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
110
      return fields;
111
    }
112
 
113
    /**
114
     * Find the _Fields constant that matches name, or null if its not found.
115
     */
116
    public static _Fields findByName(String name) {
117
      return byName.get(name);
118
    }
119
 
120
    private final short _thriftId;
121
    private final String _fieldName;
122
 
123
    _Fields(short thriftId, String fieldName) {
124
      _thriftId = thriftId;
125
      _fieldName = fieldName;
126
    }
127
 
128
    public short getThriftFieldId() {
129
      return _thriftId;
130
    }
131
 
132
    public String getFieldName() {
133
      return _fieldName;
134
    }
135
  }
136
 
137
  // isset id assignments
138
  private static final int __USER_ID_ISSET_ID = 0;
139
  private static final int __CREDITOR_ID_ISSET_ID = 1;
140
  private static final int __PAYMENT_ID_ISSET_ID = 2;
141
  private static final int __AMOUNT_ISSET_ID = 3;
142
  private static final int __CREATED_ISSET_ID = 4;
143
  private static final int __UPDATED_ISSET_ID = 5;
144
  private static final int __DUEDATE_ISSET_ID = 6;
145
  private BitSet __isset_bit_vector = new BitSet(7);
146
 
147
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
148
  static {
149
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
150
    tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("user_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
152
    tmpMap.put(_Fields.CREDITOR_ID, new org.apache.thrift.meta_data.FieldMetaData("creditor_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
153
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
154
    tmpMap.put(_Fields.PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("payment_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
155
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
156
    tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
157
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
158
    tmpMap.put(_Fields.CREDITTYPE, new org.apache.thrift.meta_data.FieldMetaData("credittype", org.apache.thrift.TFieldRequirementType.DEFAULT, 
159
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CreditTxnType.class)));
160
    tmpMap.put(_Fields.CREATED, new org.apache.thrift.meta_data.FieldMetaData("created", org.apache.thrift.TFieldRequirementType.DEFAULT, 
161
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
162
    tmpMap.put(_Fields.UPDATED, new org.apache.thrift.meta_data.FieldMetaData("updated", org.apache.thrift.TFieldRequirementType.DEFAULT, 
163
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
164
    tmpMap.put(_Fields.LOAN_ID, new org.apache.thrift.meta_data.FieldMetaData("loan_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
165
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
166
    tmpMap.put(_Fields.SHIPPING_ID, new org.apache.thrift.meta_data.FieldMetaData("shipping_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
167
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
168
    tmpMap.put(_Fields.DUE_DATE, new org.apache.thrift.meta_data.FieldMetaData("dueDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
169
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
170
    metaDataMap = Collections.unmodifiableMap(tmpMap);
171
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CreditHistory.class, metaDataMap);
172
  }
173
 
174
  public CreditHistory() {
175
  }
176
 
177
  public CreditHistory(
178
    long user_id,
179
    long creditor_id,
180
    long payment_id,
181
    double amount,
182
    CreditTxnType credittype,
183
    long created,
184
    long updated,
185
    String loan_id,
186
    String shipping_id,
187
    long dueDate)
188
  {
189
    this();
190
    this.user_id = user_id;
191
    setUser_idIsSet(true);
192
    this.creditor_id = creditor_id;
193
    setCreditor_idIsSet(true);
194
    this.payment_id = payment_id;
195
    setPayment_idIsSet(true);
196
    this.amount = amount;
197
    setAmountIsSet(true);
198
    this.credittype = credittype;
199
    this.created = created;
200
    setCreatedIsSet(true);
201
    this.updated = updated;
202
    setUpdatedIsSet(true);
203
    this.loan_id = loan_id;
204
    this.shipping_id = shipping_id;
205
    this.dueDate = dueDate;
206
    setDueDateIsSet(true);
207
  }
208
 
209
  /**
210
   * Performs a deep copy on <i>other</i>.
211
   */
212
  public CreditHistory(CreditHistory other) {
213
    __isset_bit_vector.clear();
214
    __isset_bit_vector.or(other.__isset_bit_vector);
215
    this.user_id = other.user_id;
216
    this.creditor_id = other.creditor_id;
217
    this.payment_id = other.payment_id;
218
    this.amount = other.amount;
219
    if (other.isSetCredittype()) {
220
      this.credittype = other.credittype;
221
    }
222
    this.created = other.created;
223
    this.updated = other.updated;
224
    if (other.isSetLoan_id()) {
225
      this.loan_id = other.loan_id;
226
    }
227
    if (other.isSetShipping_id()) {
228
      this.shipping_id = other.shipping_id;
229
    }
230
    this.dueDate = other.dueDate;
231
  }
232
 
233
  public CreditHistory deepCopy() {
234
    return new CreditHistory(this);
235
  }
236
 
237
  @Override
238
  public void clear() {
239
    setUser_idIsSet(false);
240
    this.user_id = 0;
241
    setCreditor_idIsSet(false);
242
    this.creditor_id = 0;
243
    setPayment_idIsSet(false);
244
    this.payment_id = 0;
245
    setAmountIsSet(false);
246
    this.amount = 0.0;
247
    this.credittype = null;
248
    setCreatedIsSet(false);
249
    this.created = 0;
250
    setUpdatedIsSet(false);
251
    this.updated = 0;
252
    this.loan_id = null;
253
    this.shipping_id = null;
254
    setDueDateIsSet(false);
255
    this.dueDate = 0;
256
  }
257
 
258
  public long getUser_id() {
259
    return this.user_id;
260
  }
261
 
262
  public void setUser_id(long user_id) {
263
    this.user_id = user_id;
264
    setUser_idIsSet(true);
265
  }
266
 
267
  public void unsetUser_id() {
268
    __isset_bit_vector.clear(__USER_ID_ISSET_ID);
269
  }
270
 
271
  /** Returns true if field user_id is set (has been assigned a value) and false otherwise */
272
  public boolean isSetUser_id() {
273
    return __isset_bit_vector.get(__USER_ID_ISSET_ID);
274
  }
275
 
276
  public void setUser_idIsSet(boolean value) {
277
    __isset_bit_vector.set(__USER_ID_ISSET_ID, value);
278
  }
279
 
280
  public long getCreditor_id() {
281
    return this.creditor_id;
282
  }
283
 
284
  public void setCreditor_id(long creditor_id) {
285
    this.creditor_id = creditor_id;
286
    setCreditor_idIsSet(true);
287
  }
288
 
289
  public void unsetCreditor_id() {
290
    __isset_bit_vector.clear(__CREDITOR_ID_ISSET_ID);
291
  }
292
 
293
  /** Returns true if field creditor_id is set (has been assigned a value) and false otherwise */
294
  public boolean isSetCreditor_id() {
295
    return __isset_bit_vector.get(__CREDITOR_ID_ISSET_ID);
296
  }
297
 
298
  public void setCreditor_idIsSet(boolean value) {
299
    __isset_bit_vector.set(__CREDITOR_ID_ISSET_ID, value);
300
  }
301
 
302
  public long getPayment_id() {
303
    return this.payment_id;
304
  }
305
 
306
  public void setPayment_id(long payment_id) {
307
    this.payment_id = payment_id;
308
    setPayment_idIsSet(true);
309
  }
310
 
311
  public void unsetPayment_id() {
312
    __isset_bit_vector.clear(__PAYMENT_ID_ISSET_ID);
313
  }
314
 
315
  /** Returns true if field payment_id is set (has been assigned a value) and false otherwise */
316
  public boolean isSetPayment_id() {
317
    return __isset_bit_vector.get(__PAYMENT_ID_ISSET_ID);
318
  }
319
 
320
  public void setPayment_idIsSet(boolean value) {
321
    __isset_bit_vector.set(__PAYMENT_ID_ISSET_ID, value);
322
  }
323
 
324
  public double getAmount() {
325
    return this.amount;
326
  }
327
 
328
  public void setAmount(double amount) {
329
    this.amount = amount;
330
    setAmountIsSet(true);
331
  }
332
 
333
  public void unsetAmount() {
334
    __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
335
  }
336
 
337
  /** Returns true if field amount is set (has been assigned a value) and false otherwise */
338
  public boolean isSetAmount() {
339
    return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
340
  }
341
 
342
  public void setAmountIsSet(boolean value) {
343
    __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
344
  }
345
 
346
  /**
347
   * 
348
   * @see CreditTxnType
349
   */
350
  public CreditTxnType getCredittype() {
351
    return this.credittype;
352
  }
353
 
354
  /**
355
   * 
356
   * @see CreditTxnType
357
   */
358
  public void setCredittype(CreditTxnType credittype) {
359
    this.credittype = credittype;
360
  }
361
 
362
  public void unsetCredittype() {
363
    this.credittype = null;
364
  }
365
 
366
  /** Returns true if field credittype is set (has been assigned a value) and false otherwise */
367
  public boolean isSetCredittype() {
368
    return this.credittype != null;
369
  }
370
 
371
  public void setCredittypeIsSet(boolean value) {
372
    if (!value) {
373
      this.credittype = null;
374
    }
375
  }
376
 
377
  public long getCreated() {
378
    return this.created;
379
  }
380
 
381
  public void setCreated(long created) {
382
    this.created = created;
383
    setCreatedIsSet(true);
384
  }
385
 
386
  public void unsetCreated() {
387
    __isset_bit_vector.clear(__CREATED_ISSET_ID);
388
  }
389
 
390
  /** Returns true if field created is set (has been assigned a value) and false otherwise */
391
  public boolean isSetCreated() {
392
    return __isset_bit_vector.get(__CREATED_ISSET_ID);
393
  }
394
 
395
  public void setCreatedIsSet(boolean value) {
396
    __isset_bit_vector.set(__CREATED_ISSET_ID, value);
397
  }
398
 
399
  public long getUpdated() {
400
    return this.updated;
401
  }
402
 
403
  public void setUpdated(long updated) {
404
    this.updated = updated;
405
    setUpdatedIsSet(true);
406
  }
407
 
408
  public void unsetUpdated() {
409
    __isset_bit_vector.clear(__UPDATED_ISSET_ID);
410
  }
411
 
412
  /** Returns true if field updated is set (has been assigned a value) and false otherwise */
413
  public boolean isSetUpdated() {
414
    return __isset_bit_vector.get(__UPDATED_ISSET_ID);
415
  }
416
 
417
  public void setUpdatedIsSet(boolean value) {
418
    __isset_bit_vector.set(__UPDATED_ISSET_ID, value);
419
  }
420
 
421
  public String getLoan_id() {
422
    return this.loan_id;
423
  }
424
 
425
  public void setLoan_id(String loan_id) {
426
    this.loan_id = loan_id;
427
  }
428
 
429
  public void unsetLoan_id() {
430
    this.loan_id = null;
431
  }
432
 
433
  /** Returns true if field loan_id is set (has been assigned a value) and false otherwise */
434
  public boolean isSetLoan_id() {
435
    return this.loan_id != null;
436
  }
437
 
438
  public void setLoan_idIsSet(boolean value) {
439
    if (!value) {
440
      this.loan_id = null;
441
    }
442
  }
443
 
444
  public String getShipping_id() {
445
    return this.shipping_id;
446
  }
447
 
448
  public void setShipping_id(String shipping_id) {
449
    this.shipping_id = shipping_id;
450
  }
451
 
452
  public void unsetShipping_id() {
453
    this.shipping_id = null;
454
  }
455
 
456
  /** Returns true if field shipping_id is set (has been assigned a value) and false otherwise */
457
  public boolean isSetShipping_id() {
458
    return this.shipping_id != null;
459
  }
460
 
461
  public void setShipping_idIsSet(boolean value) {
462
    if (!value) {
463
      this.shipping_id = null;
464
    }
465
  }
466
 
467
  public long getDueDate() {
468
    return this.dueDate;
469
  }
470
 
471
  public void setDueDate(long dueDate) {
472
    this.dueDate = dueDate;
473
    setDueDateIsSet(true);
474
  }
475
 
476
  public void unsetDueDate() {
477
    __isset_bit_vector.clear(__DUEDATE_ISSET_ID);
478
  }
479
 
480
  /** Returns true if field dueDate is set (has been assigned a value) and false otherwise */
481
  public boolean isSetDueDate() {
482
    return __isset_bit_vector.get(__DUEDATE_ISSET_ID);
483
  }
484
 
485
  public void setDueDateIsSet(boolean value) {
486
    __isset_bit_vector.set(__DUEDATE_ISSET_ID, value);
487
  }
488
 
489
  public void setFieldValue(_Fields field, Object value) {
490
    switch (field) {
491
    case USER_ID:
492
      if (value == null) {
493
        unsetUser_id();
494
      } else {
495
        setUser_id((Long)value);
496
      }
497
      break;
498
 
499
    case CREDITOR_ID:
500
      if (value == null) {
501
        unsetCreditor_id();
502
      } else {
503
        setCreditor_id((Long)value);
504
      }
505
      break;
506
 
507
    case PAYMENT_ID:
508
      if (value == null) {
509
        unsetPayment_id();
510
      } else {
511
        setPayment_id((Long)value);
512
      }
513
      break;
514
 
515
    case AMOUNT:
516
      if (value == null) {
517
        unsetAmount();
518
      } else {
519
        setAmount((Double)value);
520
      }
521
      break;
522
 
523
    case CREDITTYPE:
524
      if (value == null) {
525
        unsetCredittype();
526
      } else {
527
        setCredittype((CreditTxnType)value);
528
      }
529
      break;
530
 
531
    case CREATED:
532
      if (value == null) {
533
        unsetCreated();
534
      } else {
535
        setCreated((Long)value);
536
      }
537
      break;
538
 
539
    case UPDATED:
540
      if (value == null) {
541
        unsetUpdated();
542
      } else {
543
        setUpdated((Long)value);
544
      }
545
      break;
546
 
547
    case LOAN_ID:
548
      if (value == null) {
549
        unsetLoan_id();
550
      } else {
551
        setLoan_id((String)value);
552
      }
553
      break;
554
 
555
    case SHIPPING_ID:
556
      if (value == null) {
557
        unsetShipping_id();
558
      } else {
559
        setShipping_id((String)value);
560
      }
561
      break;
562
 
563
    case DUE_DATE:
564
      if (value == null) {
565
        unsetDueDate();
566
      } else {
567
        setDueDate((Long)value);
568
      }
569
      break;
570
 
571
    }
572
  }
573
 
574
  public Object getFieldValue(_Fields field) {
575
    switch (field) {
576
    case USER_ID:
577
      return Long.valueOf(getUser_id());
578
 
579
    case CREDITOR_ID:
580
      return Long.valueOf(getCreditor_id());
581
 
582
    case PAYMENT_ID:
583
      return Long.valueOf(getPayment_id());
584
 
585
    case AMOUNT:
586
      return Double.valueOf(getAmount());
587
 
588
    case CREDITTYPE:
589
      return getCredittype();
590
 
591
    case CREATED:
592
      return Long.valueOf(getCreated());
593
 
594
    case UPDATED:
595
      return Long.valueOf(getUpdated());
596
 
597
    case LOAN_ID:
598
      return getLoan_id();
599
 
600
    case SHIPPING_ID:
601
      return getShipping_id();
602
 
603
    case DUE_DATE:
604
      return Long.valueOf(getDueDate());
605
 
606
    }
607
    throw new IllegalStateException();
608
  }
609
 
610
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
611
  public boolean isSet(_Fields field) {
612
    if (field == null) {
613
      throw new IllegalArgumentException();
614
    }
615
 
616
    switch (field) {
617
    case USER_ID:
618
      return isSetUser_id();
619
    case CREDITOR_ID:
620
      return isSetCreditor_id();
621
    case PAYMENT_ID:
622
      return isSetPayment_id();
623
    case AMOUNT:
624
      return isSetAmount();
625
    case CREDITTYPE:
626
      return isSetCredittype();
627
    case CREATED:
628
      return isSetCreated();
629
    case UPDATED:
630
      return isSetUpdated();
631
    case LOAN_ID:
632
      return isSetLoan_id();
633
    case SHIPPING_ID:
634
      return isSetShipping_id();
635
    case DUE_DATE:
636
      return isSetDueDate();
637
    }
638
    throw new IllegalStateException();
639
  }
640
 
641
  @Override
642
  public boolean equals(Object that) {
643
    if (that == null)
644
      return false;
645
    if (that instanceof CreditHistory)
646
      return this.equals((CreditHistory)that);
647
    return false;
648
  }
649
 
650
  public boolean equals(CreditHistory that) {
651
    if (that == null)
652
      return false;
653
 
654
    boolean this_present_user_id = true;
655
    boolean that_present_user_id = true;
656
    if (this_present_user_id || that_present_user_id) {
657
      if (!(this_present_user_id && that_present_user_id))
658
        return false;
659
      if (this.user_id != that.user_id)
660
        return false;
661
    }
662
 
663
    boolean this_present_creditor_id = true;
664
    boolean that_present_creditor_id = true;
665
    if (this_present_creditor_id || that_present_creditor_id) {
666
      if (!(this_present_creditor_id && that_present_creditor_id))
667
        return false;
668
      if (this.creditor_id != that.creditor_id)
669
        return false;
670
    }
671
 
672
    boolean this_present_payment_id = true;
673
    boolean that_present_payment_id = true;
674
    if (this_present_payment_id || that_present_payment_id) {
675
      if (!(this_present_payment_id && that_present_payment_id))
676
        return false;
677
      if (this.payment_id != that.payment_id)
678
        return false;
679
    }
680
 
681
    boolean this_present_amount = true;
682
    boolean that_present_amount = true;
683
    if (this_present_amount || that_present_amount) {
684
      if (!(this_present_amount && that_present_amount))
685
        return false;
686
      if (this.amount != that.amount)
687
        return false;
688
    }
689
 
690
    boolean this_present_credittype = true && this.isSetCredittype();
691
    boolean that_present_credittype = true && that.isSetCredittype();
692
    if (this_present_credittype || that_present_credittype) {
693
      if (!(this_present_credittype && that_present_credittype))
694
        return false;
695
      if (!this.credittype.equals(that.credittype))
696
        return false;
697
    }
698
 
699
    boolean this_present_created = true;
700
    boolean that_present_created = true;
701
    if (this_present_created || that_present_created) {
702
      if (!(this_present_created && that_present_created))
703
        return false;
704
      if (this.created != that.created)
705
        return false;
706
    }
707
 
708
    boolean this_present_updated = true;
709
    boolean that_present_updated = true;
710
    if (this_present_updated || that_present_updated) {
711
      if (!(this_present_updated && that_present_updated))
712
        return false;
713
      if (this.updated != that.updated)
714
        return false;
715
    }
716
 
717
    boolean this_present_loan_id = true && this.isSetLoan_id();
718
    boolean that_present_loan_id = true && that.isSetLoan_id();
719
    if (this_present_loan_id || that_present_loan_id) {
720
      if (!(this_present_loan_id && that_present_loan_id))
721
        return false;
722
      if (!this.loan_id.equals(that.loan_id))
723
        return false;
724
    }
725
 
726
    boolean this_present_shipping_id = true && this.isSetShipping_id();
727
    boolean that_present_shipping_id = true && that.isSetShipping_id();
728
    if (this_present_shipping_id || that_present_shipping_id) {
729
      if (!(this_present_shipping_id && that_present_shipping_id))
730
        return false;
731
      if (!this.shipping_id.equals(that.shipping_id))
732
        return false;
733
    }
734
 
735
    boolean this_present_dueDate = true;
736
    boolean that_present_dueDate = true;
737
    if (this_present_dueDate || that_present_dueDate) {
738
      if (!(this_present_dueDate && that_present_dueDate))
739
        return false;
740
      if (this.dueDate != that.dueDate)
741
        return false;
742
    }
743
 
744
    return true;
745
  }
746
 
747
  @Override
748
  public int hashCode() {
749
    return 0;
750
  }
751
 
752
  public int compareTo(CreditHistory other) {
753
    if (!getClass().equals(other.getClass())) {
754
      return getClass().getName().compareTo(other.getClass().getName());
755
    }
756
 
757
    int lastComparison = 0;
758
    CreditHistory typedOther = (CreditHistory)other;
759
 
760
    lastComparison = Boolean.valueOf(isSetUser_id()).compareTo(typedOther.isSetUser_id());
761
    if (lastComparison != 0) {
762
      return lastComparison;
763
    }
764
    if (isSetUser_id()) {
765
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user_id, typedOther.user_id);
766
      if (lastComparison != 0) {
767
        return lastComparison;
768
      }
769
    }
770
    lastComparison = Boolean.valueOf(isSetCreditor_id()).compareTo(typedOther.isSetCreditor_id());
771
    if (lastComparison != 0) {
772
      return lastComparison;
773
    }
774
    if (isSetCreditor_id()) {
775
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creditor_id, typedOther.creditor_id);
776
      if (lastComparison != 0) {
777
        return lastComparison;
778
      }
779
    }
780
    lastComparison = Boolean.valueOf(isSetPayment_id()).compareTo(typedOther.isSetPayment_id());
781
    if (lastComparison != 0) {
782
      return lastComparison;
783
    }
784
    if (isSetPayment_id()) {
785
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.payment_id, typedOther.payment_id);
786
      if (lastComparison != 0) {
787
        return lastComparison;
788
      }
789
    }
790
    lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
791
    if (lastComparison != 0) {
792
      return lastComparison;
793
    }
794
    if (isSetAmount()) {
795
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
796
      if (lastComparison != 0) {
797
        return lastComparison;
798
      }
799
    }
800
    lastComparison = Boolean.valueOf(isSetCredittype()).compareTo(typedOther.isSetCredittype());
801
    if (lastComparison != 0) {
802
      return lastComparison;
803
    }
804
    if (isSetCredittype()) {
805
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credittype, typedOther.credittype);
806
      if (lastComparison != 0) {
807
        return lastComparison;
808
      }
809
    }
810
    lastComparison = Boolean.valueOf(isSetCreated()).compareTo(typedOther.isSetCreated());
811
    if (lastComparison != 0) {
812
      return lastComparison;
813
    }
814
    if (isSetCreated()) {
815
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.created, typedOther.created);
816
      if (lastComparison != 0) {
817
        return lastComparison;
818
      }
819
    }
820
    lastComparison = Boolean.valueOf(isSetUpdated()).compareTo(typedOther.isSetUpdated());
821
    if (lastComparison != 0) {
822
      return lastComparison;
823
    }
824
    if (isSetUpdated()) {
825
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updated, typedOther.updated);
826
      if (lastComparison != 0) {
827
        return lastComparison;
828
      }
829
    }
830
    lastComparison = Boolean.valueOf(isSetLoan_id()).compareTo(typedOther.isSetLoan_id());
831
    if (lastComparison != 0) {
832
      return lastComparison;
833
    }
834
    if (isSetLoan_id()) {
835
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loan_id, typedOther.loan_id);
836
      if (lastComparison != 0) {
837
        return lastComparison;
838
      }
839
    }
840
    lastComparison = Boolean.valueOf(isSetShipping_id()).compareTo(typedOther.isSetShipping_id());
841
    if (lastComparison != 0) {
842
      return lastComparison;
843
    }
844
    if (isSetShipping_id()) {
845
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shipping_id, typedOther.shipping_id);
846
      if (lastComparison != 0) {
847
        return lastComparison;
848
      }
849
    }
850
    lastComparison = Boolean.valueOf(isSetDueDate()).compareTo(typedOther.isSetDueDate());
851
    if (lastComparison != 0) {
852
      return lastComparison;
853
    }
854
    if (isSetDueDate()) {
855
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dueDate, typedOther.dueDate);
856
      if (lastComparison != 0) {
857
        return lastComparison;
858
      }
859
    }
860
    return 0;
861
  }
862
 
863
  public _Fields fieldForId(int fieldId) {
864
    return _Fields.findByThriftId(fieldId);
865
  }
866
 
867
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
868
    org.apache.thrift.protocol.TField field;
869
    iprot.readStructBegin();
870
    while (true)
871
    {
872
      field = iprot.readFieldBegin();
873
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
874
        break;
875
      }
876
      switch (field.id) {
877
        case 1: // USER_ID
878
          if (field.type == org.apache.thrift.protocol.TType.I64) {
879
            this.user_id = iprot.readI64();
880
            setUser_idIsSet(true);
881
          } else { 
882
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
883
          }
884
          break;
885
        case 2: // CREDITOR_ID
886
          if (field.type == org.apache.thrift.protocol.TType.I64) {
887
            this.creditor_id = iprot.readI64();
888
            setCreditor_idIsSet(true);
889
          } else { 
890
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
891
          }
892
          break;
893
        case 3: // PAYMENT_ID
894
          if (field.type == org.apache.thrift.protocol.TType.I64) {
895
            this.payment_id = iprot.readI64();
896
            setPayment_idIsSet(true);
897
          } else { 
898
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
899
          }
900
          break;
901
        case 4: // AMOUNT
902
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
903
            this.amount = iprot.readDouble();
904
            setAmountIsSet(true);
905
          } else { 
906
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
907
          }
908
          break;
909
        case 5: // CREDITTYPE
910
          if (field.type == org.apache.thrift.protocol.TType.I32) {
911
            this.credittype = CreditTxnType.findByValue(iprot.readI32());
912
          } else { 
913
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
914
          }
915
          break;
916
        case 6: // CREATED
917
          if (field.type == org.apache.thrift.protocol.TType.I64) {
918
            this.created = iprot.readI64();
919
            setCreatedIsSet(true);
920
          } else { 
921
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
922
          }
923
          break;
924
        case 7: // UPDATED
925
          if (field.type == org.apache.thrift.protocol.TType.I64) {
926
            this.updated = iprot.readI64();
927
            setUpdatedIsSet(true);
928
          } else { 
929
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
930
          }
931
          break;
932
        case 8: // LOAN_ID
933
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
934
            this.loan_id = iprot.readString();
935
          } else { 
936
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
937
          }
938
          break;
939
        case 9: // SHIPPING_ID
940
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
941
            this.shipping_id = iprot.readString();
942
          } else { 
943
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
944
          }
945
          break;
946
        case 10: // DUE_DATE
947
          if (field.type == org.apache.thrift.protocol.TType.I64) {
948
            this.dueDate = iprot.readI64();
949
            setDueDateIsSet(true);
950
          } else { 
951
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
952
          }
953
          break;
954
        default:
955
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
956
      }
957
      iprot.readFieldEnd();
958
    }
959
    iprot.readStructEnd();
960
    validate();
961
  }
962
 
963
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
964
    validate();
965
 
966
    oprot.writeStructBegin(STRUCT_DESC);
967
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
968
    oprot.writeI64(this.user_id);
969
    oprot.writeFieldEnd();
970
    oprot.writeFieldBegin(CREDITOR_ID_FIELD_DESC);
971
    oprot.writeI64(this.creditor_id);
972
    oprot.writeFieldEnd();
973
    oprot.writeFieldBegin(PAYMENT_ID_FIELD_DESC);
974
    oprot.writeI64(this.payment_id);
975
    oprot.writeFieldEnd();
976
    oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
977
    oprot.writeDouble(this.amount);
978
    oprot.writeFieldEnd();
979
    if (this.credittype != null) {
980
      oprot.writeFieldBegin(CREDITTYPE_FIELD_DESC);
981
      oprot.writeI32(this.credittype.getValue());
982
      oprot.writeFieldEnd();
983
    }
984
    oprot.writeFieldBegin(CREATED_FIELD_DESC);
985
    oprot.writeI64(this.created);
986
    oprot.writeFieldEnd();
987
    oprot.writeFieldBegin(UPDATED_FIELD_DESC);
988
    oprot.writeI64(this.updated);
989
    oprot.writeFieldEnd();
990
    if (this.loan_id != null) {
991
      oprot.writeFieldBegin(LOAN_ID_FIELD_DESC);
992
      oprot.writeString(this.loan_id);
993
      oprot.writeFieldEnd();
994
    }
995
    if (this.shipping_id != null) {
996
      oprot.writeFieldBegin(SHIPPING_ID_FIELD_DESC);
997
      oprot.writeString(this.shipping_id);
998
      oprot.writeFieldEnd();
999
    }
1000
    oprot.writeFieldBegin(DUE_DATE_FIELD_DESC);
1001
    oprot.writeI64(this.dueDate);
1002
    oprot.writeFieldEnd();
1003
    oprot.writeFieldStop();
1004
    oprot.writeStructEnd();
1005
  }
1006
 
1007
  @Override
1008
  public String toString() {
1009
    StringBuilder sb = new StringBuilder("CreditHistory(");
1010
    boolean first = true;
1011
 
1012
    sb.append("user_id:");
1013
    sb.append(this.user_id);
1014
    first = false;
1015
    if (!first) sb.append(", ");
1016
    sb.append("creditor_id:");
1017
    sb.append(this.creditor_id);
1018
    first = false;
1019
    if (!first) sb.append(", ");
1020
    sb.append("payment_id:");
1021
    sb.append(this.payment_id);
1022
    first = false;
1023
    if (!first) sb.append(", ");
1024
    sb.append("amount:");
1025
    sb.append(this.amount);
1026
    first = false;
1027
    if (!first) sb.append(", ");
1028
    sb.append("credittype:");
1029
    if (this.credittype == null) {
1030
      sb.append("null");
1031
    } else {
1032
      sb.append(this.credittype);
1033
    }
1034
    first = false;
1035
    if (!first) sb.append(", ");
1036
    sb.append("created:");
1037
    sb.append(this.created);
1038
    first = false;
1039
    if (!first) sb.append(", ");
1040
    sb.append("updated:");
1041
    sb.append(this.updated);
1042
    first = false;
1043
    if (!first) sb.append(", ");
1044
    sb.append("loan_id:");
1045
    if (this.loan_id == null) {
1046
      sb.append("null");
1047
    } else {
1048
      sb.append(this.loan_id);
1049
    }
1050
    first = false;
1051
    if (!first) sb.append(", ");
1052
    sb.append("shipping_id:");
1053
    if (this.shipping_id == null) {
1054
      sb.append("null");
1055
    } else {
1056
      sb.append(this.shipping_id);
1057
    }
1058
    first = false;
1059
    if (!first) sb.append(", ");
1060
    sb.append("dueDate:");
1061
    sb.append(this.dueDate);
1062
    first = false;
1063
    sb.append(")");
1064
    return sb.toString();
1065
  }
1066
 
1067
  public void validate() throws org.apache.thrift.TException {
1068
    // check for required fields
1069
  }
1070
 
1071
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1072
    try {
1073
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1074
    } catch (org.apache.thrift.TException te) {
1075
      throw new java.io.IOException(te);
1076
    }
1077
  }
1078
 
1079
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1080
    try {
1081
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1082
      __isset_bit_vector = new BitSet(1);
1083
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1084
    } catch (org.apache.thrift.TException te) {
1085
      throw new java.io.IOException(te);
1086
    }
1087
  }
1088
 
1089
}
1090