Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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