Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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