Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4600 varun.gupt 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 PaymentSettlement implements org.apache.thrift.TBase<PaymentSettlement, PaymentSettlement._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PaymentSettlement");
25
 
26
  private static final org.apache.thrift.protocol.TField GATEWAY_TXN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayTxnId", org.apache.thrift.protocol.TType.STRING, (short)1);
27
  private static final org.apache.thrift.protocol.TField PAYMENT_GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("paymentGatewayId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField PAYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("paymentId", 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 SERVICE_TAX_FIELD_DESC = new org.apache.thrift.protocol.TField("serviceTax", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
31
  private static final org.apache.thrift.protocol.TField OTHER_CHARGES_FIELD_DESC = new org.apache.thrift.protocol.TField("otherCharges", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
32
  private static final org.apache.thrift.protocol.TField NET_COLLECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("netCollection", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
33
 
34
  private String gatewayTxnId; // required
35
  private long paymentGatewayId; // required
36
  private long paymentId; // required
37
  private long settlementDate; // required
38
  private double serviceTax; // required
39
  private double otherCharges; // required
40
  private double netCollection; // 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
    GATEWAY_TXN_ID((short)1, "gatewayTxnId"),
45
    PAYMENT_GATEWAY_ID((short)2, "paymentGatewayId"),
46
    PAYMENT_ID((short)3, "paymentId"),
47
    SETTLEMENT_DATE((short)4, "settlementDate"),
48
    SERVICE_TAX((short)5, "serviceTax"),
49
    OTHER_CHARGES((short)6, "otherCharges"),
50
    NET_COLLECTION((short)7, "netCollection");
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: // GATEWAY_TXN_ID
66
          return GATEWAY_TXN_ID;
67
        case 2: // PAYMENT_GATEWAY_ID
68
          return PAYMENT_GATEWAY_ID;
69
        case 3: // PAYMENT_ID
70
          return PAYMENT_ID;
71
        case 4: // SETTLEMENT_DATE
72
          return SETTLEMENT_DATE;
73
        case 5: // SERVICE_TAX
74
          return SERVICE_TAX;
75
        case 6: // OTHER_CHARGES
76
          return OTHER_CHARGES;
77
        case 7: // NET_COLLECTION
78
          return NET_COLLECTION;
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 __PAYMENTGATEWAYID_ISSET_ID = 0;
120
  private static final int __PAYMENTID_ISSET_ID = 1;
121
  private static final int __SETTLEMENTDATE_ISSET_ID = 2;
122
  private static final int __SERVICETAX_ISSET_ID = 3;
123
  private static final int __OTHERCHARGES_ISSET_ID = 4;
124
  private static final int __NETCOLLECTION_ISSET_ID = 5;
125
  private BitSet __isset_bit_vector = new BitSet(6);
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.GATEWAY_TXN_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayTxnId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
132
    tmpMap.put(_Fields.PAYMENT_GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("paymentGatewayId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
134
    tmpMap.put(_Fields.PAYMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("paymentId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
136
    tmpMap.put(_Fields.SETTLEMENT_DATE, new org.apache.thrift.meta_data.FieldMetaData("settlementDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
138
    tmpMap.put(_Fields.SERVICE_TAX, new org.apache.thrift.meta_data.FieldMetaData("serviceTax", org.apache.thrift.TFieldRequirementType.DEFAULT, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
140
    tmpMap.put(_Fields.OTHER_CHARGES, new org.apache.thrift.meta_data.FieldMetaData("otherCharges", org.apache.thrift.TFieldRequirementType.DEFAULT, 
141
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
142
    tmpMap.put(_Fields.NET_COLLECTION, new org.apache.thrift.meta_data.FieldMetaData("netCollection", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
144
    metaDataMap = Collections.unmodifiableMap(tmpMap);
145
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PaymentSettlement.class, metaDataMap);
146
  }
147
 
148
  public PaymentSettlement() {
149
  }
150
 
151
  public PaymentSettlement(
152
    String gatewayTxnId,
153
    long paymentGatewayId,
154
    long paymentId,
155
    long settlementDate,
156
    double serviceTax,
157
    double otherCharges,
158
    double netCollection)
159
  {
160
    this();
161
    this.gatewayTxnId = gatewayTxnId;
162
    this.paymentGatewayId = paymentGatewayId;
163
    setPaymentGatewayIdIsSet(true);
164
    this.paymentId = paymentId;
165
    setPaymentIdIsSet(true);
166
    this.settlementDate = settlementDate;
167
    setSettlementDateIsSet(true);
168
    this.serviceTax = serviceTax;
169
    setServiceTaxIsSet(true);
170
    this.otherCharges = otherCharges;
171
    setOtherChargesIsSet(true);
172
    this.netCollection = netCollection;
173
    setNetCollectionIsSet(true);
174
  }
175
 
176
  /**
177
   * Performs a deep copy on <i>other</i>.
178
   */
179
  public PaymentSettlement(PaymentSettlement other) {
180
    __isset_bit_vector.clear();
181
    __isset_bit_vector.or(other.__isset_bit_vector);
182
    if (other.isSetGatewayTxnId()) {
183
      this.gatewayTxnId = other.gatewayTxnId;
184
    }
185
    this.paymentGatewayId = other.paymentGatewayId;
186
    this.paymentId = other.paymentId;
187
    this.settlementDate = other.settlementDate;
188
    this.serviceTax = other.serviceTax;
189
    this.otherCharges = other.otherCharges;
190
    this.netCollection = other.netCollection;
191
  }
192
 
193
  public PaymentSettlement deepCopy() {
194
    return new PaymentSettlement(this);
195
  }
196
 
197
  @Override
198
  public void clear() {
199
    this.gatewayTxnId = null;
200
    setPaymentGatewayIdIsSet(false);
201
    this.paymentGatewayId = 0;
202
    setPaymentIdIsSet(false);
203
    this.paymentId = 0;
204
    setSettlementDateIsSet(false);
205
    this.settlementDate = 0;
206
    setServiceTaxIsSet(false);
207
    this.serviceTax = 0.0;
208
    setOtherChargesIsSet(false);
209
    this.otherCharges = 0.0;
210
    setNetCollectionIsSet(false);
211
    this.netCollection = 0.0;
212
  }
213
 
214
  public String getGatewayTxnId() {
215
    return this.gatewayTxnId;
216
  }
217
 
218
  public void setGatewayTxnId(String gatewayTxnId) {
219
    this.gatewayTxnId = gatewayTxnId;
220
  }
221
 
222
  public void unsetGatewayTxnId() {
223
    this.gatewayTxnId = null;
224
  }
225
 
226
  /** Returns true if field gatewayTxnId is set (has been assigned a value) and false otherwise */
227
  public boolean isSetGatewayTxnId() {
228
    return this.gatewayTxnId != null;
229
  }
230
 
231
  public void setGatewayTxnIdIsSet(boolean value) {
232
    if (!value) {
233
      this.gatewayTxnId = null;
234
    }
235
  }
236
 
237
  public long getPaymentGatewayId() {
238
    return this.paymentGatewayId;
239
  }
240
 
241
  public void setPaymentGatewayId(long paymentGatewayId) {
242
    this.paymentGatewayId = paymentGatewayId;
243
    setPaymentGatewayIdIsSet(true);
244
  }
245
 
246
  public void unsetPaymentGatewayId() {
247
    __isset_bit_vector.clear(__PAYMENTGATEWAYID_ISSET_ID);
248
  }
249
 
250
  /** Returns true if field paymentGatewayId is set (has been assigned a value) and false otherwise */
251
  public boolean isSetPaymentGatewayId() {
252
    return __isset_bit_vector.get(__PAYMENTGATEWAYID_ISSET_ID);
253
  }
254
 
255
  public void setPaymentGatewayIdIsSet(boolean value) {
256
    __isset_bit_vector.set(__PAYMENTGATEWAYID_ISSET_ID, value);
257
  }
258
 
259
  public long getPaymentId() {
260
    return this.paymentId;
261
  }
262
 
263
  public void setPaymentId(long paymentId) {
264
    this.paymentId = paymentId;
265
    setPaymentIdIsSet(true);
266
  }
267
 
268
  public void unsetPaymentId() {
269
    __isset_bit_vector.clear(__PAYMENTID_ISSET_ID);
270
  }
271
 
272
  /** Returns true if field paymentId is set (has been assigned a value) and false otherwise */
273
  public boolean isSetPaymentId() {
274
    return __isset_bit_vector.get(__PAYMENTID_ISSET_ID);
275
  }
276
 
277
  public void setPaymentIdIsSet(boolean value) {
278
    __isset_bit_vector.set(__PAYMENTID_ISSET_ID, value);
279
  }
280
 
281
  public long getSettlementDate() {
282
    return this.settlementDate;
283
  }
284
 
285
  public void setSettlementDate(long settlementDate) {
286
    this.settlementDate = settlementDate;
287
    setSettlementDateIsSet(true);
288
  }
289
 
290
  public void unsetSettlementDate() {
291
    __isset_bit_vector.clear(__SETTLEMENTDATE_ISSET_ID);
292
  }
293
 
294
  /** Returns true if field settlementDate is set (has been assigned a value) and false otherwise */
295
  public boolean isSetSettlementDate() {
296
    return __isset_bit_vector.get(__SETTLEMENTDATE_ISSET_ID);
297
  }
298
 
299
  public void setSettlementDateIsSet(boolean value) {
300
    __isset_bit_vector.set(__SETTLEMENTDATE_ISSET_ID, value);
301
  }
302
 
303
  public double getServiceTax() {
304
    return this.serviceTax;
305
  }
306
 
307
  public void setServiceTax(double serviceTax) {
308
    this.serviceTax = serviceTax;
309
    setServiceTaxIsSet(true);
310
  }
311
 
312
  public void unsetServiceTax() {
313
    __isset_bit_vector.clear(__SERVICETAX_ISSET_ID);
314
  }
315
 
316
  /** Returns true if field serviceTax is set (has been assigned a value) and false otherwise */
317
  public boolean isSetServiceTax() {
318
    return __isset_bit_vector.get(__SERVICETAX_ISSET_ID);
319
  }
320
 
321
  public void setServiceTaxIsSet(boolean value) {
322
    __isset_bit_vector.set(__SERVICETAX_ISSET_ID, value);
323
  }
324
 
325
  public double getOtherCharges() {
326
    return this.otherCharges;
327
  }
328
 
329
  public void setOtherCharges(double otherCharges) {
330
    this.otherCharges = otherCharges;
331
    setOtherChargesIsSet(true);
332
  }
333
 
334
  public void unsetOtherCharges() {
335
    __isset_bit_vector.clear(__OTHERCHARGES_ISSET_ID);
336
  }
337
 
338
  /** Returns true if field otherCharges is set (has been assigned a value) and false otherwise */
339
  public boolean isSetOtherCharges() {
340
    return __isset_bit_vector.get(__OTHERCHARGES_ISSET_ID);
341
  }
342
 
343
  public void setOtherChargesIsSet(boolean value) {
344
    __isset_bit_vector.set(__OTHERCHARGES_ISSET_ID, value);
345
  }
346
 
347
  public double getNetCollection() {
348
    return this.netCollection;
349
  }
350
 
351
  public void setNetCollection(double netCollection) {
352
    this.netCollection = netCollection;
353
    setNetCollectionIsSet(true);
354
  }
355
 
356
  public void unsetNetCollection() {
357
    __isset_bit_vector.clear(__NETCOLLECTION_ISSET_ID);
358
  }
359
 
360
  /** Returns true if field netCollection is set (has been assigned a value) and false otherwise */
361
  public boolean isSetNetCollection() {
362
    return __isset_bit_vector.get(__NETCOLLECTION_ISSET_ID);
363
  }
364
 
365
  public void setNetCollectionIsSet(boolean value) {
366
    __isset_bit_vector.set(__NETCOLLECTION_ISSET_ID, value);
367
  }
368
 
369
  public void setFieldValue(_Fields field, Object value) {
370
    switch (field) {
371
    case GATEWAY_TXN_ID:
372
      if (value == null) {
373
        unsetGatewayTxnId();
374
      } else {
375
        setGatewayTxnId((String)value);
376
      }
377
      break;
378
 
379
    case PAYMENT_GATEWAY_ID:
380
      if (value == null) {
381
        unsetPaymentGatewayId();
382
      } else {
383
        setPaymentGatewayId((Long)value);
384
      }
385
      break;
386
 
387
    case PAYMENT_ID:
388
      if (value == null) {
389
        unsetPaymentId();
390
      } else {
391
        setPaymentId((Long)value);
392
      }
393
      break;
394
 
395
    case SETTLEMENT_DATE:
396
      if (value == null) {
397
        unsetSettlementDate();
398
      } else {
399
        setSettlementDate((Long)value);
400
      }
401
      break;
402
 
403
    case SERVICE_TAX:
404
      if (value == null) {
405
        unsetServiceTax();
406
      } else {
407
        setServiceTax((Double)value);
408
      }
409
      break;
410
 
411
    case OTHER_CHARGES:
412
      if (value == null) {
413
        unsetOtherCharges();
414
      } else {
415
        setOtherCharges((Double)value);
416
      }
417
      break;
418
 
419
    case NET_COLLECTION:
420
      if (value == null) {
421
        unsetNetCollection();
422
      } else {
423
        setNetCollection((Double)value);
424
      }
425
      break;
426
 
427
    }
428
  }
429
 
430
  public Object getFieldValue(_Fields field) {
431
    switch (field) {
432
    case GATEWAY_TXN_ID:
433
      return getGatewayTxnId();
434
 
435
    case PAYMENT_GATEWAY_ID:
436
      return Long.valueOf(getPaymentGatewayId());
437
 
438
    case PAYMENT_ID:
439
      return Long.valueOf(getPaymentId());
440
 
441
    case SETTLEMENT_DATE:
442
      return Long.valueOf(getSettlementDate());
443
 
444
    case SERVICE_TAX:
445
      return Double.valueOf(getServiceTax());
446
 
447
    case OTHER_CHARGES:
448
      return Double.valueOf(getOtherCharges());
449
 
450
    case NET_COLLECTION:
451
      return Double.valueOf(getNetCollection());
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 GATEWAY_TXN_ID:
465
      return isSetGatewayTxnId();
466
    case PAYMENT_GATEWAY_ID:
467
      return isSetPaymentGatewayId();
468
    case PAYMENT_ID:
469
      return isSetPaymentId();
470
    case SETTLEMENT_DATE:
471
      return isSetSettlementDate();
472
    case SERVICE_TAX:
473
      return isSetServiceTax();
474
    case OTHER_CHARGES:
475
      return isSetOtherCharges();
476
    case NET_COLLECTION:
477
      return isSetNetCollection();
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 PaymentSettlement)
487
      return this.equals((PaymentSettlement)that);
488
    return false;
489
  }
490
 
491
  public boolean equals(PaymentSettlement that) {
492
    if (that == null)
493
      return false;
494
 
495
    boolean this_present_gatewayTxnId = true && this.isSetGatewayTxnId();
496
    boolean that_present_gatewayTxnId = true && that.isSetGatewayTxnId();
497
    if (this_present_gatewayTxnId || that_present_gatewayTxnId) {
498
      if (!(this_present_gatewayTxnId && that_present_gatewayTxnId))
499
        return false;
500
      if (!this.gatewayTxnId.equals(that.gatewayTxnId))
501
        return false;
502
    }
503
 
504
    boolean this_present_paymentGatewayId = true;
505
    boolean that_present_paymentGatewayId = true;
506
    if (this_present_paymentGatewayId || that_present_paymentGatewayId) {
507
      if (!(this_present_paymentGatewayId && that_present_paymentGatewayId))
508
        return false;
509
      if (this.paymentGatewayId != that.paymentGatewayId)
510
        return false;
511
    }
512
 
513
    boolean this_present_paymentId = true;
514
    boolean that_present_paymentId = true;
515
    if (this_present_paymentId || that_present_paymentId) {
516
      if (!(this_present_paymentId && that_present_paymentId))
517
        return false;
518
      if (this.paymentId != that.paymentId)
519
        return false;
520
    }
521
 
522
    boolean this_present_settlementDate = true;
523
    boolean that_present_settlementDate = true;
524
    if (this_present_settlementDate || that_present_settlementDate) {
525
      if (!(this_present_settlementDate && that_present_settlementDate))
526
        return false;
527
      if (this.settlementDate != that.settlementDate)
528
        return false;
529
    }
530
 
531
    boolean this_present_serviceTax = true;
532
    boolean that_present_serviceTax = true;
533
    if (this_present_serviceTax || that_present_serviceTax) {
534
      if (!(this_present_serviceTax && that_present_serviceTax))
535
        return false;
536
      if (this.serviceTax != that.serviceTax)
537
        return false;
538
    }
539
 
540
    boolean this_present_otherCharges = true;
541
    boolean that_present_otherCharges = true;
542
    if (this_present_otherCharges || that_present_otherCharges) {
543
      if (!(this_present_otherCharges && that_present_otherCharges))
544
        return false;
545
      if (this.otherCharges != that.otherCharges)
546
        return false;
547
    }
548
 
549
    boolean this_present_netCollection = true;
550
    boolean that_present_netCollection = true;
551
    if (this_present_netCollection || that_present_netCollection) {
552
      if (!(this_present_netCollection && that_present_netCollection))
553
        return false;
554
      if (this.netCollection != that.netCollection)
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(PaymentSettlement other) {
567
    if (!getClass().equals(other.getClass())) {
568
      return getClass().getName().compareTo(other.getClass().getName());
569
    }
570
 
571
    int lastComparison = 0;
572
    PaymentSettlement typedOther = (PaymentSettlement)other;
573
 
574
    lastComparison = Boolean.valueOf(isSetGatewayTxnId()).compareTo(typedOther.isSetGatewayTxnId());
575
    if (lastComparison != 0) {
576
      return lastComparison;
577
    }
578
    if (isSetGatewayTxnId()) {
579
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayTxnId, typedOther.gatewayTxnId);
580
      if (lastComparison != 0) {
581
        return lastComparison;
582
      }
583
    }
584
    lastComparison = Boolean.valueOf(isSetPaymentGatewayId()).compareTo(typedOther.isSetPaymentGatewayId());
585
    if (lastComparison != 0) {
586
      return lastComparison;
587
    }
588
    if (isSetPaymentGatewayId()) {
589
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paymentGatewayId, typedOther.paymentGatewayId);
590
      if (lastComparison != 0) {
591
        return lastComparison;
592
      }
593
    }
594
    lastComparison = Boolean.valueOf(isSetPaymentId()).compareTo(typedOther.isSetPaymentId());
595
    if (lastComparison != 0) {
596
      return lastComparison;
597
    }
598
    if (isSetPaymentId()) {
599
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.paymentId, typedOther.paymentId);
600
      if (lastComparison != 0) {
601
        return lastComparison;
602
      }
603
    }
604
    lastComparison = Boolean.valueOf(isSetSettlementDate()).compareTo(typedOther.isSetSettlementDate());
605
    if (lastComparison != 0) {
606
      return lastComparison;
607
    }
608
    if (isSetSettlementDate()) {
609
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.settlementDate, typedOther.settlementDate);
610
      if (lastComparison != 0) {
611
        return lastComparison;
612
      }
613
    }
614
    lastComparison = Boolean.valueOf(isSetServiceTax()).compareTo(typedOther.isSetServiceTax());
615
    if (lastComparison != 0) {
616
      return lastComparison;
617
    }
618
    if (isSetServiceTax()) {
619
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serviceTax, typedOther.serviceTax);
620
      if (lastComparison != 0) {
621
        return lastComparison;
622
      }
623
    }
624
    lastComparison = Boolean.valueOf(isSetOtherCharges()).compareTo(typedOther.isSetOtherCharges());
625
    if (lastComparison != 0) {
626
      return lastComparison;
627
    }
628
    if (isSetOtherCharges()) {
629
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.otherCharges, typedOther.otherCharges);
630
      if (lastComparison != 0) {
631
        return lastComparison;
632
      }
633
    }
634
    lastComparison = Boolean.valueOf(isSetNetCollection()).compareTo(typedOther.isSetNetCollection());
635
    if (lastComparison != 0) {
636
      return lastComparison;
637
    }
638
    if (isSetNetCollection()) {
639
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.netCollection, typedOther.netCollection);
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: // GATEWAY_TXN_ID
662
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
663
            this.gatewayTxnId = iprot.readString();
664
          } else { 
665
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
666
          }
667
          break;
668
        case 2: // PAYMENT_GATEWAY_ID
669
          if (field.type == org.apache.thrift.protocol.TType.I64) {
670
            this.paymentGatewayId = iprot.readI64();
671
            setPaymentGatewayIdIsSet(true);
672
          } else { 
673
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
674
          }
675
          break;
676
        case 3: // PAYMENT_ID
677
          if (field.type == org.apache.thrift.protocol.TType.I64) {
678
            this.paymentId = iprot.readI64();
679
            setPaymentIdIsSet(true);
680
          } else { 
681
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
682
          }
683
          break;
684
        case 4: // SETTLEMENT_DATE
685
          if (field.type == org.apache.thrift.protocol.TType.I64) {
686
            this.settlementDate = iprot.readI64();
687
            setSettlementDateIsSet(true);
688
          } else { 
689
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
690
          }
691
          break;
692
        case 5: // SERVICE_TAX
693
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
694
            this.serviceTax = iprot.readDouble();
695
            setServiceTaxIsSet(true);
696
          } else { 
697
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
698
          }
699
          break;
700
        case 6: // OTHER_CHARGES
701
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
702
            this.otherCharges = iprot.readDouble();
703
            setOtherChargesIsSet(true);
704
          } else { 
705
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
706
          }
707
          break;
708
        case 7: // NET_COLLECTION
709
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
710
            this.netCollection = iprot.readDouble();
711
            setNetCollectionIsSet(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
    if (this.gatewayTxnId != null) {
730
      oprot.writeFieldBegin(GATEWAY_TXN_ID_FIELD_DESC);
731
      oprot.writeString(this.gatewayTxnId);
732
      oprot.writeFieldEnd();
733
    }
734
    oprot.writeFieldBegin(PAYMENT_GATEWAY_ID_FIELD_DESC);
735
    oprot.writeI64(this.paymentGatewayId);
736
    oprot.writeFieldEnd();
737
    oprot.writeFieldBegin(PAYMENT_ID_FIELD_DESC);
738
    oprot.writeI64(this.paymentId);
739
    oprot.writeFieldEnd();
740
    oprot.writeFieldBegin(SETTLEMENT_DATE_FIELD_DESC);
741
    oprot.writeI64(this.settlementDate);
742
    oprot.writeFieldEnd();
743
    oprot.writeFieldBegin(SERVICE_TAX_FIELD_DESC);
744
    oprot.writeDouble(this.serviceTax);
745
    oprot.writeFieldEnd();
746
    oprot.writeFieldBegin(OTHER_CHARGES_FIELD_DESC);
747
    oprot.writeDouble(this.otherCharges);
748
    oprot.writeFieldEnd();
749
    oprot.writeFieldBegin(NET_COLLECTION_FIELD_DESC);
750
    oprot.writeDouble(this.netCollection);
751
    oprot.writeFieldEnd();
752
    oprot.writeFieldStop();
753
    oprot.writeStructEnd();
754
  }
755
 
756
  @Override
757
  public String toString() {
758
    StringBuilder sb = new StringBuilder("PaymentSettlement(");
759
    boolean first = true;
760
 
761
    sb.append("gatewayTxnId:");
762
    if (this.gatewayTxnId == null) {
763
      sb.append("null");
764
    } else {
765
      sb.append(this.gatewayTxnId);
766
    }
767
    first = false;
768
    if (!first) sb.append(", ");
769
    sb.append("paymentGatewayId:");
770
    sb.append(this.paymentGatewayId);
771
    first = false;
772
    if (!first) sb.append(", ");
773
    sb.append("paymentId:");
774
    sb.append(this.paymentId);
775
    first = false;
776
    if (!first) sb.append(", ");
777
    sb.append("settlementDate:");
778
    sb.append(this.settlementDate);
779
    first = false;
780
    if (!first) sb.append(", ");
781
    sb.append("serviceTax:");
782
    sb.append(this.serviceTax);
783
    first = false;
784
    if (!first) sb.append(", ");
785
    sb.append("otherCharges:");
786
    sb.append(this.otherCharges);
787
    first = false;
788
    if (!first) sb.append(", ");
789
    sb.append("netCollection:");
790
    sb.append(this.netCollection);
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