Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
2747 chandransh 1
/**
2
 * Autogenerated by Thrift
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.payments;
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.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class Refund implements TBase<Refund._Fields>, java.io.Serializable, Cloneable, Comparable<Refund> {
27
  private static final TStruct STRUCT_DESC = new TStruct("Refund");
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
30
  private static final TField PAYMENT_ID_FIELD_DESC = new TField("paymentId", TType.I64, (short)2);
31
  private static final TField GATEWAY_ID_FIELD_DESC = new TField("gatewayId", TType.I64, (short)3);
32
  private static final TField ORDER_ID_FIELD_DESC = new TField("orderId", TType.I64, (short)4);
33
  private static final TField AMOUNT_FIELD_DESC = new TField("amount", TType.DOUBLE, (short)5);
34
  private static final TField GATEWAY_TXN_ID_FIELD_DESC = new TField("gatewayTxnId", TType.STRING, (short)6);
35
  private static final TField ATTEMPTS_FIELD_DESC = new TField("attempts", TType.I32, (short)7);
36
  private static final TField CREATED_AT_FIELD_DESC = new TField("createdAt", TType.I64, (short)8);
37
  private static final TField PROCESSED_AT_FIELD_DESC = new TField("processedAt", TType.I64, (short)9);
38
  private static final TField ATTRIBUTES_FIELD_DESC = new TField("attributes", TType.LIST, (short)10);
39
 
40
  private long id;
41
  private long paymentId;
42
  private long gatewayId;
43
  private long orderId;
44
  private double amount;
45
  private String gatewayTxnId;
46
  private int attempts;
47
  private long createdAt;
48
  private long processedAt;
49
  private List<Attribute> attributes;
50
 
51
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
52
  public enum _Fields implements TFieldIdEnum {
53
    ID((short)1, "id"),
54
    PAYMENT_ID((short)2, "paymentId"),
55
    GATEWAY_ID((short)3, "gatewayId"),
56
    ORDER_ID((short)4, "orderId"),
57
    AMOUNT((short)5, "amount"),
58
    GATEWAY_TXN_ID((short)6, "gatewayTxnId"),
59
    ATTEMPTS((short)7, "attempts"),
60
    CREATED_AT((short)8, "createdAt"),
61
    PROCESSED_AT((short)9, "processedAt"),
62
    ATTRIBUTES((short)10, "attributes");
63
 
64
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
65
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
66
 
67
    static {
68
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
69
        byId.put((int)field._thriftId, field);
70
        byName.put(field.getFieldName(), field);
71
      }
72
    }
73
 
74
    /**
75
     * Find the _Fields constant that matches fieldId, or null if its not found.
76
     */
77
    public static _Fields findByThriftId(int fieldId) {
78
      return byId.get(fieldId);
79
    }
80
 
81
    /**
82
     * Find the _Fields constant that matches fieldId, throwing an exception
83
     * if it is not found.
84
     */
85
    public static _Fields findByThriftIdOrThrow(int fieldId) {
86
      _Fields fields = findByThriftId(fieldId);
87
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
88
      return fields;
89
    }
90
 
91
    /**
92
     * Find the _Fields constant that matches name, or null if its not found.
93
     */
94
    public static _Fields findByName(String name) {
95
      return byName.get(name);
96
    }
97
 
98
    private final short _thriftId;
99
    private final String _fieldName;
100
 
101
    _Fields(short thriftId, String fieldName) {
102
      _thriftId = thriftId;
103
      _fieldName = fieldName;
104
    }
105
 
106
    public short getThriftFieldId() {
107
      return _thriftId;
108
    }
109
 
110
    public String getFieldName() {
111
      return _fieldName;
112
    }
113
  }
114
 
115
  // isset id assignments
116
  private static final int __ID_ISSET_ID = 0;
117
  private static final int __PAYMENTID_ISSET_ID = 1;
118
  private static final int __GATEWAYID_ISSET_ID = 2;
119
  private static final int __ORDERID_ISSET_ID = 3;
120
  private static final int __AMOUNT_ISSET_ID = 4;
121
  private static final int __ATTEMPTS_ISSET_ID = 5;
122
  private static final int __CREATEDAT_ISSET_ID = 6;
123
  private static final int __PROCESSEDAT_ISSET_ID = 7;
124
  private BitSet __isset_bit_vector = new BitSet(8);
125
 
126
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
127
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
128
        new FieldValueMetaData(TType.I64)));
129
    put(_Fields.PAYMENT_ID, new FieldMetaData("paymentId", TFieldRequirementType.DEFAULT, 
130
        new FieldValueMetaData(TType.I64)));
131
    put(_Fields.GATEWAY_ID, new FieldMetaData("gatewayId", TFieldRequirementType.DEFAULT, 
132
        new FieldValueMetaData(TType.I64)));
133
    put(_Fields.ORDER_ID, new FieldMetaData("orderId", TFieldRequirementType.DEFAULT, 
134
        new FieldValueMetaData(TType.I64)));
135
    put(_Fields.AMOUNT, new FieldMetaData("amount", TFieldRequirementType.DEFAULT, 
136
        new FieldValueMetaData(TType.DOUBLE)));
137
    put(_Fields.GATEWAY_TXN_ID, new FieldMetaData("gatewayTxnId", TFieldRequirementType.DEFAULT, 
138
        new FieldValueMetaData(TType.STRING)));
139
    put(_Fields.ATTEMPTS, new FieldMetaData("attempts", TFieldRequirementType.DEFAULT, 
140
        new FieldValueMetaData(TType.I32)));
141
    put(_Fields.CREATED_AT, new FieldMetaData("createdAt", TFieldRequirementType.DEFAULT, 
142
        new FieldValueMetaData(TType.I64)));
143
    put(_Fields.PROCESSED_AT, new FieldMetaData("processedAt", TFieldRequirementType.DEFAULT, 
144
        new FieldValueMetaData(TType.I64)));
145
    put(_Fields.ATTRIBUTES, new FieldMetaData("attributes", TFieldRequirementType.DEFAULT, 
146
        new ListMetaData(TType.LIST, 
147
            new StructMetaData(TType.STRUCT, Attribute.class))));
148
  }});
149
 
150
  static {
151
    FieldMetaData.addStructMetaDataMap(Refund.class, metaDataMap);
152
  }
153
 
154
  public Refund() {
155
  }
156
 
157
  public Refund(
158
    long id,
159
    long paymentId,
160
    long gatewayId,
161
    long orderId,
162
    double amount,
163
    String gatewayTxnId,
164
    int attempts,
165
    long createdAt,
166
    long processedAt,
167
    List<Attribute> attributes)
168
  {
169
    this();
170
    this.id = id;
171
    setIdIsSet(true);
172
    this.paymentId = paymentId;
173
    setPaymentIdIsSet(true);
174
    this.gatewayId = gatewayId;
175
    setGatewayIdIsSet(true);
176
    this.orderId = orderId;
177
    setOrderIdIsSet(true);
178
    this.amount = amount;
179
    setAmountIsSet(true);
180
    this.gatewayTxnId = gatewayTxnId;
181
    this.attempts = attempts;
182
    setAttemptsIsSet(true);
183
    this.createdAt = createdAt;
184
    setCreatedAtIsSet(true);
185
    this.processedAt = processedAt;
186
    setProcessedAtIsSet(true);
187
    this.attributes = attributes;
188
  }
189
 
190
  /**
191
   * Performs a deep copy on <i>other</i>.
192
   */
193
  public Refund(Refund other) {
194
    __isset_bit_vector.clear();
195
    __isset_bit_vector.or(other.__isset_bit_vector);
196
    this.id = other.id;
197
    this.paymentId = other.paymentId;
198
    this.gatewayId = other.gatewayId;
199
    this.orderId = other.orderId;
200
    this.amount = other.amount;
201
    if (other.isSetGatewayTxnId()) {
202
      this.gatewayTxnId = other.gatewayTxnId;
203
    }
204
    this.attempts = other.attempts;
205
    this.createdAt = other.createdAt;
206
    this.processedAt = other.processedAt;
207
    if (other.isSetAttributes()) {
208
      List<Attribute> __this__attributes = new ArrayList<Attribute>();
209
      for (Attribute other_element : other.attributes) {
210
        __this__attributes.add(new Attribute(other_element));
211
      }
212
      this.attributes = __this__attributes;
213
    }
214
  }
215
 
216
  public Refund deepCopy() {
217
    return new Refund(this);
218
  }
219
 
220
  @Deprecated
221
  public Refund clone() {
222
    return new Refund(this);
223
  }
224
 
225
  public long getId() {
226
    return this.id;
227
  }
228
 
229
  public Refund setId(long id) {
230
    this.id = id;
231
    setIdIsSet(true);
232
    return this;
233
  }
234
 
235
  public void unsetId() {
236
    __isset_bit_vector.clear(__ID_ISSET_ID);
237
  }
238
 
239
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
240
  public boolean isSetId() {
241
    return __isset_bit_vector.get(__ID_ISSET_ID);
242
  }
243
 
244
  public void setIdIsSet(boolean value) {
245
    __isset_bit_vector.set(__ID_ISSET_ID, value);
246
  }
247
 
248
  public long getPaymentId() {
249
    return this.paymentId;
250
  }
251
 
252
  public Refund setPaymentId(long paymentId) {
253
    this.paymentId = paymentId;
254
    setPaymentIdIsSet(true);
255
    return this;
256
  }
257
 
258
  public void unsetPaymentId() {
259
    __isset_bit_vector.clear(__PAYMENTID_ISSET_ID);
260
  }
261
 
262
  /** Returns true if field paymentId is set (has been asigned a value) and false otherwise */
263
  public boolean isSetPaymentId() {
264
    return __isset_bit_vector.get(__PAYMENTID_ISSET_ID);
265
  }
266
 
267
  public void setPaymentIdIsSet(boolean value) {
268
    __isset_bit_vector.set(__PAYMENTID_ISSET_ID, value);
269
  }
270
 
271
  public long getGatewayId() {
272
    return this.gatewayId;
273
  }
274
 
275
  public Refund setGatewayId(long gatewayId) {
276
    this.gatewayId = gatewayId;
277
    setGatewayIdIsSet(true);
278
    return this;
279
  }
280
 
281
  public void unsetGatewayId() {
282
    __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
283
  }
284
 
285
  /** Returns true if field gatewayId is set (has been asigned a value) and false otherwise */
286
  public boolean isSetGatewayId() {
287
    return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
288
  }
289
 
290
  public void setGatewayIdIsSet(boolean value) {
291
    __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
292
  }
293
 
294
  public long getOrderId() {
295
    return this.orderId;
296
  }
297
 
298
  public Refund setOrderId(long orderId) {
299
    this.orderId = orderId;
300
    setOrderIdIsSet(true);
301
    return this;
302
  }
303
 
304
  public void unsetOrderId() {
305
    __isset_bit_vector.clear(__ORDERID_ISSET_ID);
306
  }
307
 
308
  /** Returns true if field orderId is set (has been asigned a value) and false otherwise */
309
  public boolean isSetOrderId() {
310
    return __isset_bit_vector.get(__ORDERID_ISSET_ID);
311
  }
312
 
313
  public void setOrderIdIsSet(boolean value) {
314
    __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
315
  }
316
 
317
  public double getAmount() {
318
    return this.amount;
319
  }
320
 
321
  public Refund setAmount(double amount) {
322
    this.amount = amount;
323
    setAmountIsSet(true);
324
    return this;
325
  }
326
 
327
  public void unsetAmount() {
328
    __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
329
  }
330
 
331
  /** Returns true if field amount is set (has been asigned a value) and false otherwise */
332
  public boolean isSetAmount() {
333
    return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
334
  }
335
 
336
  public void setAmountIsSet(boolean value) {
337
    __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
338
  }
339
 
340
  public String getGatewayTxnId() {
341
    return this.gatewayTxnId;
342
  }
343
 
344
  public Refund setGatewayTxnId(String gatewayTxnId) {
345
    this.gatewayTxnId = gatewayTxnId;
346
    return this;
347
  }
348
 
349
  public void unsetGatewayTxnId() {
350
    this.gatewayTxnId = null;
351
  }
352
 
353
  /** Returns true if field gatewayTxnId is set (has been asigned a value) and false otherwise */
354
  public boolean isSetGatewayTxnId() {
355
    return this.gatewayTxnId != null;
356
  }
357
 
358
  public void setGatewayTxnIdIsSet(boolean value) {
359
    if (!value) {
360
      this.gatewayTxnId = null;
361
    }
362
  }
363
 
364
  public int getAttempts() {
365
    return this.attempts;
366
  }
367
 
368
  public Refund setAttempts(int attempts) {
369
    this.attempts = attempts;
370
    setAttemptsIsSet(true);
371
    return this;
372
  }
373
 
374
  public void unsetAttempts() {
375
    __isset_bit_vector.clear(__ATTEMPTS_ISSET_ID);
376
  }
377
 
378
  /** Returns true if field attempts is set (has been asigned a value) and false otherwise */
379
  public boolean isSetAttempts() {
380
    return __isset_bit_vector.get(__ATTEMPTS_ISSET_ID);
381
  }
382
 
383
  public void setAttemptsIsSet(boolean value) {
384
    __isset_bit_vector.set(__ATTEMPTS_ISSET_ID, value);
385
  }
386
 
387
  public long getCreatedAt() {
388
    return this.createdAt;
389
  }
390
 
391
  public Refund setCreatedAt(long createdAt) {
392
    this.createdAt = createdAt;
393
    setCreatedAtIsSet(true);
394
    return this;
395
  }
396
 
397
  public void unsetCreatedAt() {
398
    __isset_bit_vector.clear(__CREATEDAT_ISSET_ID);
399
  }
400
 
401
  /** Returns true if field createdAt is set (has been asigned a value) and false otherwise */
402
  public boolean isSetCreatedAt() {
403
    return __isset_bit_vector.get(__CREATEDAT_ISSET_ID);
404
  }
405
 
406
  public void setCreatedAtIsSet(boolean value) {
407
    __isset_bit_vector.set(__CREATEDAT_ISSET_ID, value);
408
  }
409
 
410
  public long getProcessedAt() {
411
    return this.processedAt;
412
  }
413
 
414
  public Refund setProcessedAt(long processedAt) {
415
    this.processedAt = processedAt;
416
    setProcessedAtIsSet(true);
417
    return this;
418
  }
419
 
420
  public void unsetProcessedAt() {
421
    __isset_bit_vector.clear(__PROCESSEDAT_ISSET_ID);
422
  }
423
 
424
  /** Returns true if field processedAt is set (has been asigned a value) and false otherwise */
425
  public boolean isSetProcessedAt() {
426
    return __isset_bit_vector.get(__PROCESSEDAT_ISSET_ID);
427
  }
428
 
429
  public void setProcessedAtIsSet(boolean value) {
430
    __isset_bit_vector.set(__PROCESSEDAT_ISSET_ID, value);
431
  }
432
 
433
  public int getAttributesSize() {
434
    return (this.attributes == null) ? 0 : this.attributes.size();
435
  }
436
 
437
  public java.util.Iterator<Attribute> getAttributesIterator() {
438
    return (this.attributes == null) ? null : this.attributes.iterator();
439
  }
440
 
441
  public void addToAttributes(Attribute elem) {
442
    if (this.attributes == null) {
443
      this.attributes = new ArrayList<Attribute>();
444
    }
445
    this.attributes.add(elem);
446
  }
447
 
448
  public List<Attribute> getAttributes() {
449
    return this.attributes;
450
  }
451
 
452
  public Refund setAttributes(List<Attribute> attributes) {
453
    this.attributes = attributes;
454
    return this;
455
  }
456
 
457
  public void unsetAttributes() {
458
    this.attributes = null;
459
  }
460
 
461
  /** Returns true if field attributes is set (has been asigned a value) and false otherwise */
462
  public boolean isSetAttributes() {
463
    return this.attributes != null;
464
  }
465
 
466
  public void setAttributesIsSet(boolean value) {
467
    if (!value) {
468
      this.attributes = null;
469
    }
470
  }
471
 
472
  public void setFieldValue(_Fields field, Object value) {
473
    switch (field) {
474
    case ID:
475
      if (value == null) {
476
        unsetId();
477
      } else {
478
        setId((Long)value);
479
      }
480
      break;
481
 
482
    case PAYMENT_ID:
483
      if (value == null) {
484
        unsetPaymentId();
485
      } else {
486
        setPaymentId((Long)value);
487
      }
488
      break;
489
 
490
    case GATEWAY_ID:
491
      if (value == null) {
492
        unsetGatewayId();
493
      } else {
494
        setGatewayId((Long)value);
495
      }
496
      break;
497
 
498
    case ORDER_ID:
499
      if (value == null) {
500
        unsetOrderId();
501
      } else {
502
        setOrderId((Long)value);
503
      }
504
      break;
505
 
506
    case AMOUNT:
507
      if (value == null) {
508
        unsetAmount();
509
      } else {
510
        setAmount((Double)value);
511
      }
512
      break;
513
 
514
    case GATEWAY_TXN_ID:
515
      if (value == null) {
516
        unsetGatewayTxnId();
517
      } else {
518
        setGatewayTxnId((String)value);
519
      }
520
      break;
521
 
522
    case ATTEMPTS:
523
      if (value == null) {
524
        unsetAttempts();
525
      } else {
526
        setAttempts((Integer)value);
527
      }
528
      break;
529
 
530
    case CREATED_AT:
531
      if (value == null) {
532
        unsetCreatedAt();
533
      } else {
534
        setCreatedAt((Long)value);
535
      }
536
      break;
537
 
538
    case PROCESSED_AT:
539
      if (value == null) {
540
        unsetProcessedAt();
541
      } else {
542
        setProcessedAt((Long)value);
543
      }
544
      break;
545
 
546
    case ATTRIBUTES:
547
      if (value == null) {
548
        unsetAttributes();
549
      } else {
550
        setAttributes((List<Attribute>)value);
551
      }
552
      break;
553
 
554
    }
555
  }
556
 
557
  public void setFieldValue(int fieldID, Object value) {
558
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
559
  }
560
 
561
  public Object getFieldValue(_Fields field) {
562
    switch (field) {
563
    case ID:
564
      return new Long(getId());
565
 
566
    case PAYMENT_ID:
567
      return new Long(getPaymentId());
568
 
569
    case GATEWAY_ID:
570
      return new Long(getGatewayId());
571
 
572
    case ORDER_ID:
573
      return new Long(getOrderId());
574
 
575
    case AMOUNT:
576
      return new Double(getAmount());
577
 
578
    case GATEWAY_TXN_ID:
579
      return getGatewayTxnId();
580
 
581
    case ATTEMPTS:
582
      return new Integer(getAttempts());
583
 
584
    case CREATED_AT:
585
      return new Long(getCreatedAt());
586
 
587
    case PROCESSED_AT:
588
      return new Long(getProcessedAt());
589
 
590
    case ATTRIBUTES:
591
      return getAttributes();
592
 
593
    }
594
    throw new IllegalStateException();
595
  }
596
 
597
  public Object getFieldValue(int fieldId) {
598
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
599
  }
600
 
601
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
602
  public boolean isSet(_Fields field) {
603
    switch (field) {
604
    case ID:
605
      return isSetId();
606
    case PAYMENT_ID:
607
      return isSetPaymentId();
608
    case GATEWAY_ID:
609
      return isSetGatewayId();
610
    case ORDER_ID:
611
      return isSetOrderId();
612
    case AMOUNT:
613
      return isSetAmount();
614
    case GATEWAY_TXN_ID:
615
      return isSetGatewayTxnId();
616
    case ATTEMPTS:
617
      return isSetAttempts();
618
    case CREATED_AT:
619
      return isSetCreatedAt();
620
    case PROCESSED_AT:
621
      return isSetProcessedAt();
622
    case ATTRIBUTES:
623
      return isSetAttributes();
624
    }
625
    throw new IllegalStateException();
626
  }
627
 
628
  public boolean isSet(int fieldID) {
629
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
630
  }
631
 
632
  @Override
633
  public boolean equals(Object that) {
634
    if (that == null)
635
      return false;
636
    if (that instanceof Refund)
637
      return this.equals((Refund)that);
638
    return false;
639
  }
640
 
641
  public boolean equals(Refund that) {
642
    if (that == null)
643
      return false;
644
 
645
    boolean this_present_id = true;
646
    boolean that_present_id = true;
647
    if (this_present_id || that_present_id) {
648
      if (!(this_present_id && that_present_id))
649
        return false;
650
      if (this.id != that.id)
651
        return false;
652
    }
653
 
654
    boolean this_present_paymentId = true;
655
    boolean that_present_paymentId = true;
656
    if (this_present_paymentId || that_present_paymentId) {
657
      if (!(this_present_paymentId && that_present_paymentId))
658
        return false;
659
      if (this.paymentId != that.paymentId)
660
        return false;
661
    }
662
 
663
    boolean this_present_gatewayId = true;
664
    boolean that_present_gatewayId = true;
665
    if (this_present_gatewayId || that_present_gatewayId) {
666
      if (!(this_present_gatewayId && that_present_gatewayId))
667
        return false;
668
      if (this.gatewayId != that.gatewayId)
669
        return false;
670
    }
671
 
672
    boolean this_present_orderId = true;
673
    boolean that_present_orderId = true;
674
    if (this_present_orderId || that_present_orderId) {
675
      if (!(this_present_orderId && that_present_orderId))
676
        return false;
677
      if (this.orderId != that.orderId)
678
        return false;
679
    }
680
 
681
    boolean this_present_amount = true;
682
    boolean that_present_amount = true;
683
    if (this_present_amount || that_present_amount) {
684
      if (!(this_present_amount && that_present_amount))
685
        return false;
686
      if (this.amount != that.amount)
687
        return false;
688
    }
689
 
690
    boolean this_present_gatewayTxnId = true && this.isSetGatewayTxnId();
691
    boolean that_present_gatewayTxnId = true && that.isSetGatewayTxnId();
692
    if (this_present_gatewayTxnId || that_present_gatewayTxnId) {
693
      if (!(this_present_gatewayTxnId && that_present_gatewayTxnId))
694
        return false;
695
      if (!this.gatewayTxnId.equals(that.gatewayTxnId))
696
        return false;
697
    }
698
 
699
    boolean this_present_attempts = true;
700
    boolean that_present_attempts = true;
701
    if (this_present_attempts || that_present_attempts) {
702
      if (!(this_present_attempts && that_present_attempts))
703
        return false;
704
      if (this.attempts != that.attempts)
705
        return false;
706
    }
707
 
708
    boolean this_present_createdAt = true;
709
    boolean that_present_createdAt = true;
710
    if (this_present_createdAt || that_present_createdAt) {
711
      if (!(this_present_createdAt && that_present_createdAt))
712
        return false;
713
      if (this.createdAt != that.createdAt)
714
        return false;
715
    }
716
 
717
    boolean this_present_processedAt = true;
718
    boolean that_present_processedAt = true;
719
    if (this_present_processedAt || that_present_processedAt) {
720
      if (!(this_present_processedAt && that_present_processedAt))
721
        return false;
722
      if (this.processedAt != that.processedAt)
723
        return false;
724
    }
725
 
726
    boolean this_present_attributes = true && this.isSetAttributes();
727
    boolean that_present_attributes = true && that.isSetAttributes();
728
    if (this_present_attributes || that_present_attributes) {
729
      if (!(this_present_attributes && that_present_attributes))
730
        return false;
731
      if (!this.attributes.equals(that.attributes))
732
        return false;
733
    }
734
 
735
    return true;
736
  }
737
 
738
  @Override
739
  public int hashCode() {
740
    return 0;
741
  }
742
 
743
  public int compareTo(Refund other) {
744
    if (!getClass().equals(other.getClass())) {
745
      return getClass().getName().compareTo(other.getClass().getName());
746
    }
747
 
748
    int lastComparison = 0;
749
    Refund typedOther = (Refund)other;
750
 
751
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
752
    if (lastComparison != 0) {
753
      return lastComparison;
754
    }
755
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
756
    if (lastComparison != 0) {
757
      return lastComparison;
758
    }
759
    lastComparison = Boolean.valueOf(isSetPaymentId()).compareTo(isSetPaymentId());
760
    if (lastComparison != 0) {
761
      return lastComparison;
762
    }
763
    lastComparison = TBaseHelper.compareTo(paymentId, typedOther.paymentId);
764
    if (lastComparison != 0) {
765
      return lastComparison;
766
    }
767
    lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(isSetGatewayId());
768
    if (lastComparison != 0) {
769
      return lastComparison;
770
    }
771
    lastComparison = TBaseHelper.compareTo(gatewayId, typedOther.gatewayId);
772
    if (lastComparison != 0) {
773
      return lastComparison;
774
    }
775
    lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(isSetOrderId());
776
    if (lastComparison != 0) {
777
      return lastComparison;
778
    }
779
    lastComparison = TBaseHelper.compareTo(orderId, typedOther.orderId);
780
    if (lastComparison != 0) {
781
      return lastComparison;
782
    }
783
    lastComparison = Boolean.valueOf(isSetAmount()).compareTo(isSetAmount());
784
    if (lastComparison != 0) {
785
      return lastComparison;
786
    }
787
    lastComparison = TBaseHelper.compareTo(amount, typedOther.amount);
788
    if (lastComparison != 0) {
789
      return lastComparison;
790
    }
791
    lastComparison = Boolean.valueOf(isSetGatewayTxnId()).compareTo(isSetGatewayTxnId());
792
    if (lastComparison != 0) {
793
      return lastComparison;
794
    }
795
    lastComparison = TBaseHelper.compareTo(gatewayTxnId, typedOther.gatewayTxnId);
796
    if (lastComparison != 0) {
797
      return lastComparison;
798
    }
799
    lastComparison = Boolean.valueOf(isSetAttempts()).compareTo(isSetAttempts());
800
    if (lastComparison != 0) {
801
      return lastComparison;
802
    }
803
    lastComparison = TBaseHelper.compareTo(attempts, typedOther.attempts);
804
    if (lastComparison != 0) {
805
      return lastComparison;
806
    }
807
    lastComparison = Boolean.valueOf(isSetCreatedAt()).compareTo(isSetCreatedAt());
808
    if (lastComparison != 0) {
809
      return lastComparison;
810
    }
811
    lastComparison = TBaseHelper.compareTo(createdAt, typedOther.createdAt);
812
    if (lastComparison != 0) {
813
      return lastComparison;
814
    }
815
    lastComparison = Boolean.valueOf(isSetProcessedAt()).compareTo(isSetProcessedAt());
816
    if (lastComparison != 0) {
817
      return lastComparison;
818
    }
819
    lastComparison = TBaseHelper.compareTo(processedAt, typedOther.processedAt);
820
    if (lastComparison != 0) {
821
      return lastComparison;
822
    }
823
    lastComparison = Boolean.valueOf(isSetAttributes()).compareTo(isSetAttributes());
824
    if (lastComparison != 0) {
825
      return lastComparison;
826
    }
827
    lastComparison = TBaseHelper.compareTo(attributes, typedOther.attributes);
828
    if (lastComparison != 0) {
829
      return lastComparison;
830
    }
831
    return 0;
832
  }
833
 
834
  public void read(TProtocol iprot) throws TException {
835
    TField field;
836
    iprot.readStructBegin();
837
    while (true)
838
    {
839
      field = iprot.readFieldBegin();
840
      if (field.type == TType.STOP) { 
841
        break;
842
      }
843
      _Fields fieldId = _Fields.findByThriftId(field.id);
844
      if (fieldId == null) {
845
        TProtocolUtil.skip(iprot, field.type);
846
      } else {
847
        switch (fieldId) {
848
          case ID:
849
            if (field.type == TType.I64) {
850
              this.id = iprot.readI64();
851
              setIdIsSet(true);
852
            } else { 
853
              TProtocolUtil.skip(iprot, field.type);
854
            }
855
            break;
856
          case PAYMENT_ID:
857
            if (field.type == TType.I64) {
858
              this.paymentId = iprot.readI64();
859
              setPaymentIdIsSet(true);
860
            } else { 
861
              TProtocolUtil.skip(iprot, field.type);
862
            }
863
            break;
864
          case GATEWAY_ID:
865
            if (field.type == TType.I64) {
866
              this.gatewayId = iprot.readI64();
867
              setGatewayIdIsSet(true);
868
            } else { 
869
              TProtocolUtil.skip(iprot, field.type);
870
            }
871
            break;
872
          case ORDER_ID:
873
            if (field.type == TType.I64) {
874
              this.orderId = iprot.readI64();
875
              setOrderIdIsSet(true);
876
            } else { 
877
              TProtocolUtil.skip(iprot, field.type);
878
            }
879
            break;
880
          case AMOUNT:
881
            if (field.type == TType.DOUBLE) {
882
              this.amount = iprot.readDouble();
883
              setAmountIsSet(true);
884
            } else { 
885
              TProtocolUtil.skip(iprot, field.type);
886
            }
887
            break;
888
          case GATEWAY_TXN_ID:
889
            if (field.type == TType.STRING) {
890
              this.gatewayTxnId = iprot.readString();
891
            } else { 
892
              TProtocolUtil.skip(iprot, field.type);
893
            }
894
            break;
895
          case ATTEMPTS:
896
            if (field.type == TType.I32) {
897
              this.attempts = iprot.readI32();
898
              setAttemptsIsSet(true);
899
            } else { 
900
              TProtocolUtil.skip(iprot, field.type);
901
            }
902
            break;
903
          case CREATED_AT:
904
            if (field.type == TType.I64) {
905
              this.createdAt = iprot.readI64();
906
              setCreatedAtIsSet(true);
907
            } else { 
908
              TProtocolUtil.skip(iprot, field.type);
909
            }
910
            break;
911
          case PROCESSED_AT:
912
            if (field.type == TType.I64) {
913
              this.processedAt = iprot.readI64();
914
              setProcessedAtIsSet(true);
915
            } else { 
916
              TProtocolUtil.skip(iprot, field.type);
917
            }
918
            break;
919
          case ATTRIBUTES:
920
            if (field.type == TType.LIST) {
921
              {
922
                TList _list8 = iprot.readListBegin();
923
                this.attributes = new ArrayList<Attribute>(_list8.size);
924
                for (int _i9 = 0; _i9 < _list8.size; ++_i9)
925
                {
926
                  Attribute _elem10;
927
                  _elem10 = new Attribute();
928
                  _elem10.read(iprot);
929
                  this.attributes.add(_elem10);
930
                }
931
                iprot.readListEnd();
932
              }
933
            } else { 
934
              TProtocolUtil.skip(iprot, field.type);
935
            }
936
            break;
937
        }
938
        iprot.readFieldEnd();
939
      }
940
    }
941
    iprot.readStructEnd();
942
    validate();
943
  }
944
 
945
  public void write(TProtocol oprot) throws TException {
946
    validate();
947
 
948
    oprot.writeStructBegin(STRUCT_DESC);
949
    oprot.writeFieldBegin(ID_FIELD_DESC);
950
    oprot.writeI64(this.id);
951
    oprot.writeFieldEnd();
952
    oprot.writeFieldBegin(PAYMENT_ID_FIELD_DESC);
953
    oprot.writeI64(this.paymentId);
954
    oprot.writeFieldEnd();
955
    oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
956
    oprot.writeI64(this.gatewayId);
957
    oprot.writeFieldEnd();
958
    oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
959
    oprot.writeI64(this.orderId);
960
    oprot.writeFieldEnd();
961
    oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
962
    oprot.writeDouble(this.amount);
963
    oprot.writeFieldEnd();
964
    if (this.gatewayTxnId != null) {
965
      oprot.writeFieldBegin(GATEWAY_TXN_ID_FIELD_DESC);
966
      oprot.writeString(this.gatewayTxnId);
967
      oprot.writeFieldEnd();
968
    }
969
    oprot.writeFieldBegin(ATTEMPTS_FIELD_DESC);
970
    oprot.writeI32(this.attempts);
971
    oprot.writeFieldEnd();
972
    oprot.writeFieldBegin(CREATED_AT_FIELD_DESC);
973
    oprot.writeI64(this.createdAt);
974
    oprot.writeFieldEnd();
975
    oprot.writeFieldBegin(PROCESSED_AT_FIELD_DESC);
976
    oprot.writeI64(this.processedAt);
977
    oprot.writeFieldEnd();
978
    if (this.attributes != null) {
979
      oprot.writeFieldBegin(ATTRIBUTES_FIELD_DESC);
980
      {
981
        oprot.writeListBegin(new TList(TType.STRUCT, this.attributes.size()));
982
        for (Attribute _iter11 : this.attributes)
983
        {
984
          _iter11.write(oprot);
985
        }
986
        oprot.writeListEnd();
987
      }
988
      oprot.writeFieldEnd();
989
    }
990
    oprot.writeFieldStop();
991
    oprot.writeStructEnd();
992
  }
993
 
994
  @Override
995
  public String toString() {
996
    StringBuilder sb = new StringBuilder("Refund(");
997
    boolean first = true;
998
 
999
    sb.append("id:");
1000
    sb.append(this.id);
1001
    first = false;
1002
    if (!first) sb.append(", ");
1003
    sb.append("paymentId:");
1004
    sb.append(this.paymentId);
1005
    first = false;
1006
    if (!first) sb.append(", ");
1007
    sb.append("gatewayId:");
1008
    sb.append(this.gatewayId);
1009
    first = false;
1010
    if (!first) sb.append(", ");
1011
    sb.append("orderId:");
1012
    sb.append(this.orderId);
1013
    first = false;
1014
    if (!first) sb.append(", ");
1015
    sb.append("amount:");
1016
    sb.append(this.amount);
1017
    first = false;
1018
    if (!first) sb.append(", ");
1019
    sb.append("gatewayTxnId:");
1020
    if (this.gatewayTxnId == null) {
1021
      sb.append("null");
1022
    } else {
1023
      sb.append(this.gatewayTxnId);
1024
    }
1025
    first = false;
1026
    if (!first) sb.append(", ");
1027
    sb.append("attempts:");
1028
    sb.append(this.attempts);
1029
    first = false;
1030
    if (!first) sb.append(", ");
1031
    sb.append("createdAt:");
1032
    sb.append(this.createdAt);
1033
    first = false;
1034
    if (!first) sb.append(", ");
1035
    sb.append("processedAt:");
1036
    sb.append(this.processedAt);
1037
    first = false;
1038
    if (!first) sb.append(", ");
1039
    sb.append("attributes:");
1040
    if (this.attributes == null) {
1041
      sb.append("null");
1042
    } else {
1043
      sb.append(this.attributes);
1044
    }
1045
    first = false;
1046
    sb.append(")");
1047
    return sb.toString();
1048
  }
1049
 
1050
  public void validate() throws TException {
1051
    // check for required fields
1052
  }
1053
 
1054
}
1055