Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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