Subversion Repositories SmartDukaan

Rev

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

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