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