Subversion Repositories SmartDukaan

Rev

Rev 18578 | 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 Creditor implements org.apache.thrift.TBase<Creditor, Creditor._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Creditor");
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 NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  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)3);
18674 amit.gupta 29
  private static final org.apache.thrift.protocol.TField TICKET_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("ticket_size", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
30
  private static final org.apache.thrift.protocol.TField CREDIT_DUE_DAYS_FIELD_DESC = new org.apache.thrift.protocol.TField("credit_due_days", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField CREATED_FIELD_DESC = new org.apache.thrift.protocol.TField("created", org.apache.thrift.protocol.TType.I64, (short)6);
32
  private static final org.apache.thrift.protocol.TField UPDATED_FIELD_DESC = new org.apache.thrift.protocol.TField("updated", org.apache.thrift.protocol.TType.I64, (short)7);
18578 manish.sha 33
 
34
  private long id; // required
35
  private String name; // required
36
  private boolean active; // required
18674 amit.gupta 37
  private double ticket_size; // required
38
  private long credit_due_days; // required
18578 manish.sha 39
  private long created; // required
40
  private long updated; // required
41
 
42
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
43
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
44
    ID((short)1, "id"),
45
    NAME((short)2, "name"),
46
    ACTIVE((short)3, "active"),
18674 amit.gupta 47
    TICKET_SIZE((short)4, "ticket_size"),
48
    CREDIT_DUE_DAYS((short)5, "credit_due_days"),
49
    CREATED((short)6, "created"),
50
    UPDATED((short)7, "updated");
18578 manish.sha 51
 
52
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
53
 
54
    static {
55
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
56
        byName.put(field.getFieldName(), field);
57
      }
58
    }
59
 
60
    /**
61
     * Find the _Fields constant that matches fieldId, or null if its not found.
62
     */
63
    public static _Fields findByThriftId(int fieldId) {
64
      switch(fieldId) {
65
        case 1: // ID
66
          return ID;
67
        case 2: // NAME
68
          return NAME;
69
        case 3: // ACTIVE
70
          return ACTIVE;
18674 amit.gupta 71
        case 4: // TICKET_SIZE
72
          return TICKET_SIZE;
73
        case 5: // CREDIT_DUE_DAYS
74
          return CREDIT_DUE_DAYS;
75
        case 6: // CREATED
18578 manish.sha 76
          return CREATED;
18674 amit.gupta 77
        case 7: // UPDATED
18578 manish.sha 78
          return UPDATED;
79
        default:
80
          return null;
81
      }
82
    }
83
 
84
    /**
85
     * Find the _Fields constant that matches fieldId, throwing an exception
86
     * if it is not found.
87
     */
88
    public static _Fields findByThriftIdOrThrow(int fieldId) {
89
      _Fields fields = findByThriftId(fieldId);
90
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
91
      return fields;
92
    }
93
 
94
    /**
95
     * Find the _Fields constant that matches name, or null if its not found.
96
     */
97
    public static _Fields findByName(String name) {
98
      return byName.get(name);
99
    }
100
 
101
    private final short _thriftId;
102
    private final String _fieldName;
103
 
104
    _Fields(short thriftId, String fieldName) {
105
      _thriftId = thriftId;
106
      _fieldName = fieldName;
107
    }
108
 
109
    public short getThriftFieldId() {
110
      return _thriftId;
111
    }
112
 
113
    public String getFieldName() {
114
      return _fieldName;
115
    }
116
  }
117
 
118
  // isset id assignments
119
  private static final int __ID_ISSET_ID = 0;
120
  private static final int __ACTIVE_ISSET_ID = 1;
18674 amit.gupta 121
  private static final int __TICKET_SIZE_ISSET_ID = 2;
122
  private static final int __CREDIT_DUE_DAYS_ISSET_ID = 3;
123
  private static final int __CREATED_ISSET_ID = 4;
124
  private static final int __UPDATED_ISSET_ID = 5;
125
  private BitSet __isset_bit_vector = new BitSet(6);
18578 manish.sha 126
 
127
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
128
  static {
129
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
130
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
132
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
134
    tmpMap.put(_Fields.ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("active", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
18674 amit.gupta 136
    tmpMap.put(_Fields.TICKET_SIZE, new org.apache.thrift.meta_data.FieldMetaData("ticket_size", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
138
    tmpMap.put(_Fields.CREDIT_DUE_DAYS, new org.apache.thrift.meta_data.FieldMetaData("credit_due_days", org.apache.thrift.TFieldRequirementType.DEFAULT, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18578 manish.sha 140
    tmpMap.put(_Fields.CREATED, new org.apache.thrift.meta_data.FieldMetaData("created", org.apache.thrift.TFieldRequirementType.DEFAULT, 
141
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
142
    tmpMap.put(_Fields.UPDATED, new org.apache.thrift.meta_data.FieldMetaData("updated", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
144
    metaDataMap = Collections.unmodifiableMap(tmpMap);
145
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Creditor.class, metaDataMap);
146
  }
147
 
148
  public Creditor() {
149
  }
150
 
151
  public Creditor(
152
    long id,
153
    String name,
154
    boolean active,
18674 amit.gupta 155
    double ticket_size,
156
    long credit_due_days,
18578 manish.sha 157
    long created,
158
    long updated)
159
  {
160
    this();
161
    this.id = id;
162
    setIdIsSet(true);
163
    this.name = name;
164
    this.active = active;
165
    setActiveIsSet(true);
18674 amit.gupta 166
    this.ticket_size = ticket_size;
167
    setTicket_sizeIsSet(true);
168
    this.credit_due_days = credit_due_days;
169
    setCredit_due_daysIsSet(true);
18578 manish.sha 170
    this.created = created;
171
    setCreatedIsSet(true);
172
    this.updated = updated;
173
    setUpdatedIsSet(true);
174
  }
175
 
176
  /**
177
   * Performs a deep copy on <i>other</i>.
178
   */
179
  public Creditor(Creditor other) {
180
    __isset_bit_vector.clear();
181
    __isset_bit_vector.or(other.__isset_bit_vector);
182
    this.id = other.id;
183
    if (other.isSetName()) {
184
      this.name = other.name;
185
    }
186
    this.active = other.active;
18674 amit.gupta 187
    this.ticket_size = other.ticket_size;
188
    this.credit_due_days = other.credit_due_days;
18578 manish.sha 189
    this.created = other.created;
190
    this.updated = other.updated;
191
  }
192
 
193
  public Creditor deepCopy() {
194
    return new Creditor(this);
195
  }
196
 
197
  @Override
198
  public void clear() {
199
    setIdIsSet(false);
200
    this.id = 0;
201
    this.name = null;
202
    setActiveIsSet(false);
203
    this.active = false;
18674 amit.gupta 204
    setTicket_sizeIsSet(false);
205
    this.ticket_size = 0.0;
206
    setCredit_due_daysIsSet(false);
207
    this.credit_due_days = 0;
18578 manish.sha 208
    setCreatedIsSet(false);
209
    this.created = 0;
210
    setUpdatedIsSet(false);
211
    this.updated = 0;
212
  }
213
 
214
  public long getId() {
215
    return this.id;
216
  }
217
 
218
  public void setId(long id) {
219
    this.id = id;
220
    setIdIsSet(true);
221
  }
222
 
223
  public void unsetId() {
224
    __isset_bit_vector.clear(__ID_ISSET_ID);
225
  }
226
 
227
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
228
  public boolean isSetId() {
229
    return __isset_bit_vector.get(__ID_ISSET_ID);
230
  }
231
 
232
  public void setIdIsSet(boolean value) {
233
    __isset_bit_vector.set(__ID_ISSET_ID, value);
234
  }
235
 
236
  public String getName() {
237
    return this.name;
238
  }
239
 
240
  public void setName(String name) {
241
    this.name = name;
242
  }
243
 
244
  public void unsetName() {
245
    this.name = null;
246
  }
247
 
248
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
249
  public boolean isSetName() {
250
    return this.name != null;
251
  }
252
 
253
  public void setNameIsSet(boolean value) {
254
    if (!value) {
255
      this.name = null;
256
    }
257
  }
258
 
259
  public boolean isActive() {
260
    return this.active;
261
  }
262
 
263
  public void setActive(boolean active) {
264
    this.active = active;
265
    setActiveIsSet(true);
266
  }
267
 
268
  public void unsetActive() {
269
    __isset_bit_vector.clear(__ACTIVE_ISSET_ID);
270
  }
271
 
272
  /** Returns true if field active is set (has been assigned a value) and false otherwise */
273
  public boolean isSetActive() {
274
    return __isset_bit_vector.get(__ACTIVE_ISSET_ID);
275
  }
276
 
277
  public void setActiveIsSet(boolean value) {
278
    __isset_bit_vector.set(__ACTIVE_ISSET_ID, value);
279
  }
280
 
18674 amit.gupta 281
  public double getTicket_size() {
282
    return this.ticket_size;
283
  }
284
 
285
  public void setTicket_size(double ticket_size) {
286
    this.ticket_size = ticket_size;
287
    setTicket_sizeIsSet(true);
288
  }
289
 
290
  public void unsetTicket_size() {
291
    __isset_bit_vector.clear(__TICKET_SIZE_ISSET_ID);
292
  }
293
 
294
  /** Returns true if field ticket_size is set (has been assigned a value) and false otherwise */
295
  public boolean isSetTicket_size() {
296
    return __isset_bit_vector.get(__TICKET_SIZE_ISSET_ID);
297
  }
298
 
299
  public void setTicket_sizeIsSet(boolean value) {
300
    __isset_bit_vector.set(__TICKET_SIZE_ISSET_ID, value);
301
  }
302
 
303
  public long getCredit_due_days() {
304
    return this.credit_due_days;
305
  }
306
 
307
  public void setCredit_due_days(long credit_due_days) {
308
    this.credit_due_days = credit_due_days;
309
    setCredit_due_daysIsSet(true);
310
  }
311
 
312
  public void unsetCredit_due_days() {
313
    __isset_bit_vector.clear(__CREDIT_DUE_DAYS_ISSET_ID);
314
  }
315
 
316
  /** Returns true if field credit_due_days is set (has been assigned a value) and false otherwise */
317
  public boolean isSetCredit_due_days() {
318
    return __isset_bit_vector.get(__CREDIT_DUE_DAYS_ISSET_ID);
319
  }
320
 
321
  public void setCredit_due_daysIsSet(boolean value) {
322
    __isset_bit_vector.set(__CREDIT_DUE_DAYS_ISSET_ID, value);
323
  }
324
 
18578 manish.sha 325
  public long getCreated() {
326
    return this.created;
327
  }
328
 
329
  public void setCreated(long created) {
330
    this.created = created;
331
    setCreatedIsSet(true);
332
  }
333
 
334
  public void unsetCreated() {
335
    __isset_bit_vector.clear(__CREATED_ISSET_ID);
336
  }
337
 
338
  /** Returns true if field created is set (has been assigned a value) and false otherwise */
339
  public boolean isSetCreated() {
340
    return __isset_bit_vector.get(__CREATED_ISSET_ID);
341
  }
342
 
343
  public void setCreatedIsSet(boolean value) {
344
    __isset_bit_vector.set(__CREATED_ISSET_ID, value);
345
  }
346
 
347
  public long getUpdated() {
348
    return this.updated;
349
  }
350
 
351
  public void setUpdated(long updated) {
352
    this.updated = updated;
353
    setUpdatedIsSet(true);
354
  }
355
 
356
  public void unsetUpdated() {
357
    __isset_bit_vector.clear(__UPDATED_ISSET_ID);
358
  }
359
 
360
  /** Returns true if field updated is set (has been assigned a value) and false otherwise */
361
  public boolean isSetUpdated() {
362
    return __isset_bit_vector.get(__UPDATED_ISSET_ID);
363
  }
364
 
365
  public void setUpdatedIsSet(boolean value) {
366
    __isset_bit_vector.set(__UPDATED_ISSET_ID, value);
367
  }
368
 
369
  public void setFieldValue(_Fields field, Object value) {
370
    switch (field) {
371
    case ID:
372
      if (value == null) {
373
        unsetId();
374
      } else {
375
        setId((Long)value);
376
      }
377
      break;
378
 
379
    case NAME:
380
      if (value == null) {
381
        unsetName();
382
      } else {
383
        setName((String)value);
384
      }
385
      break;
386
 
387
    case ACTIVE:
388
      if (value == null) {
389
        unsetActive();
390
      } else {
391
        setActive((Boolean)value);
392
      }
393
      break;
394
 
18674 amit.gupta 395
    case TICKET_SIZE:
396
      if (value == null) {
397
        unsetTicket_size();
398
      } else {
399
        setTicket_size((Double)value);
400
      }
401
      break;
402
 
403
    case CREDIT_DUE_DAYS:
404
      if (value == null) {
405
        unsetCredit_due_days();
406
      } else {
407
        setCredit_due_days((Long)value);
408
      }
409
      break;
410
 
18578 manish.sha 411
    case CREATED:
412
      if (value == null) {
413
        unsetCreated();
414
      } else {
415
        setCreated((Long)value);
416
      }
417
      break;
418
 
419
    case UPDATED:
420
      if (value == null) {
421
        unsetUpdated();
422
      } else {
423
        setUpdated((Long)value);
424
      }
425
      break;
426
 
427
    }
428
  }
429
 
430
  public Object getFieldValue(_Fields field) {
431
    switch (field) {
432
    case ID:
433
      return Long.valueOf(getId());
434
 
435
    case NAME:
436
      return getName();
437
 
438
    case ACTIVE:
439
      return Boolean.valueOf(isActive());
440
 
18674 amit.gupta 441
    case TICKET_SIZE:
442
      return Double.valueOf(getTicket_size());
443
 
444
    case CREDIT_DUE_DAYS:
445
      return Long.valueOf(getCredit_due_days());
446
 
18578 manish.sha 447
    case CREATED:
448
      return Long.valueOf(getCreated());
449
 
450
    case UPDATED:
451
      return Long.valueOf(getUpdated());
452
 
453
    }
454
    throw new IllegalStateException();
455
  }
456
 
457
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
458
  public boolean isSet(_Fields field) {
459
    if (field == null) {
460
      throw new IllegalArgumentException();
461
    }
462
 
463
    switch (field) {
464
    case ID:
465
      return isSetId();
466
    case NAME:
467
      return isSetName();
468
    case ACTIVE:
469
      return isSetActive();
18674 amit.gupta 470
    case TICKET_SIZE:
471
      return isSetTicket_size();
472
    case CREDIT_DUE_DAYS:
473
      return isSetCredit_due_days();
18578 manish.sha 474
    case CREATED:
475
      return isSetCreated();
476
    case UPDATED:
477
      return isSetUpdated();
478
    }
479
    throw new IllegalStateException();
480
  }
481
 
482
  @Override
483
  public boolean equals(Object that) {
484
    if (that == null)
485
      return false;
486
    if (that instanceof Creditor)
487
      return this.equals((Creditor)that);
488
    return false;
489
  }
490
 
491
  public boolean equals(Creditor that) {
492
    if (that == null)
493
      return false;
494
 
495
    boolean this_present_id = true;
496
    boolean that_present_id = true;
497
    if (this_present_id || that_present_id) {
498
      if (!(this_present_id && that_present_id))
499
        return false;
500
      if (this.id != that.id)
501
        return false;
502
    }
503
 
504
    boolean this_present_name = true && this.isSetName();
505
    boolean that_present_name = true && that.isSetName();
506
    if (this_present_name || that_present_name) {
507
      if (!(this_present_name && that_present_name))
508
        return false;
509
      if (!this.name.equals(that.name))
510
        return false;
511
    }
512
 
513
    boolean this_present_active = true;
514
    boolean that_present_active = true;
515
    if (this_present_active || that_present_active) {
516
      if (!(this_present_active && that_present_active))
517
        return false;
518
      if (this.active != that.active)
519
        return false;
520
    }
521
 
18674 amit.gupta 522
    boolean this_present_ticket_size = true;
523
    boolean that_present_ticket_size = true;
524
    if (this_present_ticket_size || that_present_ticket_size) {
525
      if (!(this_present_ticket_size && that_present_ticket_size))
526
        return false;
527
      if (this.ticket_size != that.ticket_size)
528
        return false;
529
    }
530
 
531
    boolean this_present_credit_due_days = true;
532
    boolean that_present_credit_due_days = true;
533
    if (this_present_credit_due_days || that_present_credit_due_days) {
534
      if (!(this_present_credit_due_days && that_present_credit_due_days))
535
        return false;
536
      if (this.credit_due_days != that.credit_due_days)
537
        return false;
538
    }
539
 
18578 manish.sha 540
    boolean this_present_created = true;
541
    boolean that_present_created = true;
542
    if (this_present_created || that_present_created) {
543
      if (!(this_present_created && that_present_created))
544
        return false;
545
      if (this.created != that.created)
546
        return false;
547
    }
548
 
549
    boolean this_present_updated = true;
550
    boolean that_present_updated = true;
551
    if (this_present_updated || that_present_updated) {
552
      if (!(this_present_updated && that_present_updated))
553
        return false;
554
      if (this.updated != that.updated)
555
        return false;
556
    }
557
 
558
    return true;
559
  }
560
 
561
  @Override
562
  public int hashCode() {
563
    return 0;
564
  }
565
 
566
  public int compareTo(Creditor other) {
567
    if (!getClass().equals(other.getClass())) {
568
      return getClass().getName().compareTo(other.getClass().getName());
569
    }
570
 
571
    int lastComparison = 0;
572
    Creditor typedOther = (Creditor)other;
573
 
574
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
575
    if (lastComparison != 0) {
576
      return lastComparison;
577
    }
578
    if (isSetId()) {
579
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
580
      if (lastComparison != 0) {
581
        return lastComparison;
582
      }
583
    }
584
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
585
    if (lastComparison != 0) {
586
      return lastComparison;
587
    }
588
    if (isSetName()) {
589
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
590
      if (lastComparison != 0) {
591
        return lastComparison;
592
      }
593
    }
594
    lastComparison = Boolean.valueOf(isSetActive()).compareTo(typedOther.isSetActive());
595
    if (lastComparison != 0) {
596
      return lastComparison;
597
    }
598
    if (isSetActive()) {
599
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.active, typedOther.active);
600
      if (lastComparison != 0) {
601
        return lastComparison;
602
      }
603
    }
18674 amit.gupta 604
    lastComparison = Boolean.valueOf(isSetTicket_size()).compareTo(typedOther.isSetTicket_size());
605
    if (lastComparison != 0) {
606
      return lastComparison;
607
    }
608
    if (isSetTicket_size()) {
609
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ticket_size, typedOther.ticket_size);
610
      if (lastComparison != 0) {
611
        return lastComparison;
612
      }
613
    }
614
    lastComparison = Boolean.valueOf(isSetCredit_due_days()).compareTo(typedOther.isSetCredit_due_days());
615
    if (lastComparison != 0) {
616
      return lastComparison;
617
    }
618
    if (isSetCredit_due_days()) {
619
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credit_due_days, typedOther.credit_due_days);
620
      if (lastComparison != 0) {
621
        return lastComparison;
622
      }
623
    }
18578 manish.sha 624
    lastComparison = Boolean.valueOf(isSetCreated()).compareTo(typedOther.isSetCreated());
625
    if (lastComparison != 0) {
626
      return lastComparison;
627
    }
628
    if (isSetCreated()) {
629
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.created, typedOther.created);
630
      if (lastComparison != 0) {
631
        return lastComparison;
632
      }
633
    }
634
    lastComparison = Boolean.valueOf(isSetUpdated()).compareTo(typedOther.isSetUpdated());
635
    if (lastComparison != 0) {
636
      return lastComparison;
637
    }
638
    if (isSetUpdated()) {
639
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updated, typedOther.updated);
640
      if (lastComparison != 0) {
641
        return lastComparison;
642
      }
643
    }
644
    return 0;
645
  }
646
 
647
  public _Fields fieldForId(int fieldId) {
648
    return _Fields.findByThriftId(fieldId);
649
  }
650
 
651
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
652
    org.apache.thrift.protocol.TField field;
653
    iprot.readStructBegin();
654
    while (true)
655
    {
656
      field = iprot.readFieldBegin();
657
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
658
        break;
659
      }
660
      switch (field.id) {
661
        case 1: // ID
662
          if (field.type == org.apache.thrift.protocol.TType.I64) {
663
            this.id = iprot.readI64();
664
            setIdIsSet(true);
665
          } else { 
666
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
667
          }
668
          break;
669
        case 2: // NAME
670
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
671
            this.name = iprot.readString();
672
          } else { 
673
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
674
          }
675
          break;
676
        case 3: // ACTIVE
677
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
678
            this.active = iprot.readBool();
679
            setActiveIsSet(true);
680
          } else { 
681
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
682
          }
683
          break;
18674 amit.gupta 684
        case 4: // TICKET_SIZE
685
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
686
            this.ticket_size = iprot.readDouble();
687
            setTicket_sizeIsSet(true);
688
          } else { 
689
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
690
          }
691
          break;
692
        case 5: // CREDIT_DUE_DAYS
18578 manish.sha 693
          if (field.type == org.apache.thrift.protocol.TType.I64) {
18674 amit.gupta 694
            this.credit_due_days = iprot.readI64();
695
            setCredit_due_daysIsSet(true);
696
          } else { 
697
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
698
          }
699
          break;
700
        case 6: // CREATED
701
          if (field.type == org.apache.thrift.protocol.TType.I64) {
18578 manish.sha 702
            this.created = iprot.readI64();
703
            setCreatedIsSet(true);
704
          } else { 
705
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
706
          }
707
          break;
18674 amit.gupta 708
        case 7: // UPDATED
18578 manish.sha 709
          if (field.type == org.apache.thrift.protocol.TType.I64) {
710
            this.updated = iprot.readI64();
711
            setUpdatedIsSet(true);
712
          } else { 
713
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
714
          }
715
          break;
716
        default:
717
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
718
      }
719
      iprot.readFieldEnd();
720
    }
721
    iprot.readStructEnd();
722
    validate();
723
  }
724
 
725
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
726
    validate();
727
 
728
    oprot.writeStructBegin(STRUCT_DESC);
729
    oprot.writeFieldBegin(ID_FIELD_DESC);
730
    oprot.writeI64(this.id);
731
    oprot.writeFieldEnd();
732
    if (this.name != null) {
733
      oprot.writeFieldBegin(NAME_FIELD_DESC);
734
      oprot.writeString(this.name);
735
      oprot.writeFieldEnd();
736
    }
737
    oprot.writeFieldBegin(ACTIVE_FIELD_DESC);
738
    oprot.writeBool(this.active);
739
    oprot.writeFieldEnd();
18674 amit.gupta 740
    oprot.writeFieldBegin(TICKET_SIZE_FIELD_DESC);
741
    oprot.writeDouble(this.ticket_size);
742
    oprot.writeFieldEnd();
743
    oprot.writeFieldBegin(CREDIT_DUE_DAYS_FIELD_DESC);
744
    oprot.writeI64(this.credit_due_days);
745
    oprot.writeFieldEnd();
18578 manish.sha 746
    oprot.writeFieldBegin(CREATED_FIELD_DESC);
747
    oprot.writeI64(this.created);
748
    oprot.writeFieldEnd();
749
    oprot.writeFieldBegin(UPDATED_FIELD_DESC);
750
    oprot.writeI64(this.updated);
751
    oprot.writeFieldEnd();
752
    oprot.writeFieldStop();
753
    oprot.writeStructEnd();
754
  }
755
 
756
  @Override
757
  public String toString() {
758
    StringBuilder sb = new StringBuilder("Creditor(");
759
    boolean first = true;
760
 
761
    sb.append("id:");
762
    sb.append(this.id);
763
    first = false;
764
    if (!first) sb.append(", ");
765
    sb.append("name:");
766
    if (this.name == null) {
767
      sb.append("null");
768
    } else {
769
      sb.append(this.name);
770
    }
771
    first = false;
772
    if (!first) sb.append(", ");
773
    sb.append("active:");
774
    sb.append(this.active);
775
    first = false;
776
    if (!first) sb.append(", ");
18674 amit.gupta 777
    sb.append("ticket_size:");
778
    sb.append(this.ticket_size);
779
    first = false;
780
    if (!first) sb.append(", ");
781
    sb.append("credit_due_days:");
782
    sb.append(this.credit_due_days);
783
    first = false;
784
    if (!first) sb.append(", ");
18578 manish.sha 785
    sb.append("created:");
786
    sb.append(this.created);
787
    first = false;
788
    if (!first) sb.append(", ");
789
    sb.append("updated:");
790
    sb.append(this.updated);
791
    first = false;
792
    sb.append(")");
793
    return sb.toString();
794
  }
795
 
796
  public void validate() throws org.apache.thrift.TException {
797
    // check for required fields
798
  }
799
 
800
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
801
    try {
802
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
803
    } catch (org.apache.thrift.TException te) {
804
      throw new java.io.IOException(te);
805
    }
806
  }
807
 
808
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
809
    try {
810
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
811
      __isset_bit_vector = new BitSet(1);
812
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
813
    } catch (org.apache.thrift.TException te) {
814
      throw new java.io.IOException(te);
815
    }
816
  }
817
 
818
}
819