Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
6389 rajveer 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 EmiScheme implements org.apache.thrift.TBase<EmiScheme, EmiScheme._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("EmiScheme");
25
 
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField BANK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("bankId", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField TENURE_FIELD_DESC = new org.apache.thrift.protocol.TField("tenure", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField BANK_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("bankName", org.apache.thrift.protocol.TType.STRING, (short)5);
31
  private static final org.apache.thrift.protocol.TField MIN_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("minAmount", org.apache.thrift.protocol.TType.STRING, (short)6);
32
  private static final org.apache.thrift.protocol.TField TENURE_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("tenureDescription", org.apache.thrift.protocol.TType.STRING, (short)7);
33
  private static final org.apache.thrift.protocol.TField CHARGE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("chargeType", org.apache.thrift.protocol.TType.I32, (short)8);
34
  private static final org.apache.thrift.protocol.TField CHARGE_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("chargeValue", org.apache.thrift.protocol.TType.I64, (short)9);
35
 
36
  private long id; // required
37
  private long gatewayId; // required
38
  private long bankId; // required
39
  private long tenure; // required
40
  private String bankName; // required
41
  private String minAmount; // required
42
  private String tenureDescription; // required
43
  private EmiChargeType chargeType; // required
44
  private long chargeValue; // required
45
 
46
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
47
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
48
    ID((short)1, "id"),
49
    GATEWAY_ID((short)2, "gatewayId"),
50
    BANK_ID((short)3, "bankId"),
51
    TENURE((short)4, "tenure"),
52
    BANK_NAME((short)5, "bankName"),
53
    MIN_AMOUNT((short)6, "minAmount"),
54
    TENURE_DESCRIPTION((short)7, "tenureDescription"),
55
    /**
56
     * 
57
     * @see EmiChargeType
58
     */
59
    CHARGE_TYPE((short)8, "chargeType"),
60
    CHARGE_VALUE((short)9, "chargeValue");
61
 
62
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
63
 
64
    static {
65
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
66
        byName.put(field.getFieldName(), field);
67
      }
68
    }
69
 
70
    /**
71
     * Find the _Fields constant that matches fieldId, or null if its not found.
72
     */
73
    public static _Fields findByThriftId(int fieldId) {
74
      switch(fieldId) {
75
        case 1: // ID
76
          return ID;
77
        case 2: // GATEWAY_ID
78
          return GATEWAY_ID;
79
        case 3: // BANK_ID
80
          return BANK_ID;
81
        case 4: // TENURE
82
          return TENURE;
83
        case 5: // BANK_NAME
84
          return BANK_NAME;
85
        case 6: // MIN_AMOUNT
86
          return MIN_AMOUNT;
87
        case 7: // TENURE_DESCRIPTION
88
          return TENURE_DESCRIPTION;
89
        case 8: // CHARGE_TYPE
90
          return CHARGE_TYPE;
91
        case 9: // CHARGE_VALUE
92
          return CHARGE_VALUE;
93
        default:
94
          return null;
95
      }
96
    }
97
 
98
    /**
99
     * Find the _Fields constant that matches fieldId, throwing an exception
100
     * if it is not found.
101
     */
102
    public static _Fields findByThriftIdOrThrow(int fieldId) {
103
      _Fields fields = findByThriftId(fieldId);
104
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
105
      return fields;
106
    }
107
 
108
    /**
109
     * Find the _Fields constant that matches name, or null if its not found.
110
     */
111
    public static _Fields findByName(String name) {
112
      return byName.get(name);
113
    }
114
 
115
    private final short _thriftId;
116
    private final String _fieldName;
117
 
118
    _Fields(short thriftId, String fieldName) {
119
      _thriftId = thriftId;
120
      _fieldName = fieldName;
121
    }
122
 
123
    public short getThriftFieldId() {
124
      return _thriftId;
125
    }
126
 
127
    public String getFieldName() {
128
      return _fieldName;
129
    }
130
  }
131
 
132
  // isset id assignments
133
  private static final int __ID_ISSET_ID = 0;
134
  private static final int __GATEWAYID_ISSET_ID = 1;
135
  private static final int __BANKID_ISSET_ID = 2;
136
  private static final int __TENURE_ISSET_ID = 3;
137
  private static final int __CHARGEVALUE_ISSET_ID = 4;
138
  private BitSet __isset_bit_vector = new BitSet(5);
139
 
140
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
141
  static {
142
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
143
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
145
    tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
147
    tmpMap.put(_Fields.BANK_ID, new org.apache.thrift.meta_data.FieldMetaData("bankId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
149
    tmpMap.put(_Fields.TENURE, new org.apache.thrift.meta_data.FieldMetaData("tenure", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
151
    tmpMap.put(_Fields.BANK_NAME, new org.apache.thrift.meta_data.FieldMetaData("bankName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
153
    tmpMap.put(_Fields.MIN_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("minAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
155
    tmpMap.put(_Fields.TENURE_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("tenureDescription", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
157
    tmpMap.put(_Fields.CHARGE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("chargeType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EmiChargeType.class)));
159
    tmpMap.put(_Fields.CHARGE_VALUE, new org.apache.thrift.meta_data.FieldMetaData("chargeValue", org.apache.thrift.TFieldRequirementType.DEFAULT, 
160
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
161
    metaDataMap = Collections.unmodifiableMap(tmpMap);
162
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(EmiScheme.class, metaDataMap);
163
  }
164
 
165
  public EmiScheme() {
166
  }
167
 
168
  public EmiScheme(
169
    long id,
170
    long gatewayId,
171
    long bankId,
172
    long tenure,
173
    String bankName,
174
    String minAmount,
175
    String tenureDescription,
176
    EmiChargeType chargeType,
177
    long chargeValue)
178
  {
179
    this();
180
    this.id = id;
181
    setIdIsSet(true);
182
    this.gatewayId = gatewayId;
183
    setGatewayIdIsSet(true);
184
    this.bankId = bankId;
185
    setBankIdIsSet(true);
186
    this.tenure = tenure;
187
    setTenureIsSet(true);
188
    this.bankName = bankName;
189
    this.minAmount = minAmount;
190
    this.tenureDescription = tenureDescription;
191
    this.chargeType = chargeType;
192
    this.chargeValue = chargeValue;
193
    setChargeValueIsSet(true);
194
  }
195
 
196
  /**
197
   * Performs a deep copy on <i>other</i>.
198
   */
199
  public EmiScheme(EmiScheme other) {
200
    __isset_bit_vector.clear();
201
    __isset_bit_vector.or(other.__isset_bit_vector);
202
    this.id = other.id;
203
    this.gatewayId = other.gatewayId;
204
    this.bankId = other.bankId;
205
    this.tenure = other.tenure;
206
    if (other.isSetBankName()) {
207
      this.bankName = other.bankName;
208
    }
209
    if (other.isSetMinAmount()) {
210
      this.minAmount = other.minAmount;
211
    }
212
    if (other.isSetTenureDescription()) {
213
      this.tenureDescription = other.tenureDescription;
214
    }
215
    if (other.isSetChargeType()) {
216
      this.chargeType = other.chargeType;
217
    }
218
    this.chargeValue = other.chargeValue;
219
  }
220
 
221
  public EmiScheme deepCopy() {
222
    return new EmiScheme(this);
223
  }
224
 
225
  @Override
226
  public void clear() {
227
    setIdIsSet(false);
228
    this.id = 0;
229
    setGatewayIdIsSet(false);
230
    this.gatewayId = 0;
231
    setBankIdIsSet(false);
232
    this.bankId = 0;
233
    setTenureIsSet(false);
234
    this.tenure = 0;
235
    this.bankName = null;
236
    this.minAmount = null;
237
    this.tenureDescription = null;
238
    this.chargeType = null;
239
    setChargeValueIsSet(false);
240
    this.chargeValue = 0;
241
  }
242
 
243
  public long getId() {
244
    return this.id;
245
  }
246
 
247
  public void setId(long id) {
248
    this.id = id;
249
    setIdIsSet(true);
250
  }
251
 
252
  public void unsetId() {
253
    __isset_bit_vector.clear(__ID_ISSET_ID);
254
  }
255
 
256
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
257
  public boolean isSetId() {
258
    return __isset_bit_vector.get(__ID_ISSET_ID);
259
  }
260
 
261
  public void setIdIsSet(boolean value) {
262
    __isset_bit_vector.set(__ID_ISSET_ID, value);
263
  }
264
 
265
  public long getGatewayId() {
266
    return this.gatewayId;
267
  }
268
 
269
  public void setGatewayId(long gatewayId) {
270
    this.gatewayId = gatewayId;
271
    setGatewayIdIsSet(true);
272
  }
273
 
274
  public void unsetGatewayId() {
275
    __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
276
  }
277
 
278
  /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
279
  public boolean isSetGatewayId() {
280
    return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
281
  }
282
 
283
  public void setGatewayIdIsSet(boolean value) {
284
    __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
285
  }
286
 
287
  public long getBankId() {
288
    return this.bankId;
289
  }
290
 
291
  public void setBankId(long bankId) {
292
    this.bankId = bankId;
293
    setBankIdIsSet(true);
294
  }
295
 
296
  public void unsetBankId() {
297
    __isset_bit_vector.clear(__BANKID_ISSET_ID);
298
  }
299
 
300
  /** Returns true if field bankId is set (has been assigned a value) and false otherwise */
301
  public boolean isSetBankId() {
302
    return __isset_bit_vector.get(__BANKID_ISSET_ID);
303
  }
304
 
305
  public void setBankIdIsSet(boolean value) {
306
    __isset_bit_vector.set(__BANKID_ISSET_ID, value);
307
  }
308
 
309
  public long getTenure() {
310
    return this.tenure;
311
  }
312
 
313
  public void setTenure(long tenure) {
314
    this.tenure = tenure;
315
    setTenureIsSet(true);
316
  }
317
 
318
  public void unsetTenure() {
319
    __isset_bit_vector.clear(__TENURE_ISSET_ID);
320
  }
321
 
322
  /** Returns true if field tenure is set (has been assigned a value) and false otherwise */
323
  public boolean isSetTenure() {
324
    return __isset_bit_vector.get(__TENURE_ISSET_ID);
325
  }
326
 
327
  public void setTenureIsSet(boolean value) {
328
    __isset_bit_vector.set(__TENURE_ISSET_ID, value);
329
  }
330
 
331
  public String getBankName() {
332
    return this.bankName;
333
  }
334
 
335
  public void setBankName(String bankName) {
336
    this.bankName = bankName;
337
  }
338
 
339
  public void unsetBankName() {
340
    this.bankName = null;
341
  }
342
 
343
  /** Returns true if field bankName is set (has been assigned a value) and false otherwise */
344
  public boolean isSetBankName() {
345
    return this.bankName != null;
346
  }
347
 
348
  public void setBankNameIsSet(boolean value) {
349
    if (!value) {
350
      this.bankName = null;
351
    }
352
  }
353
 
354
  public String getMinAmount() {
355
    return this.minAmount;
356
  }
357
 
358
  public void setMinAmount(String minAmount) {
359
    this.minAmount = minAmount;
360
  }
361
 
362
  public void unsetMinAmount() {
363
    this.minAmount = null;
364
  }
365
 
366
  /** Returns true if field minAmount is set (has been assigned a value) and false otherwise */
367
  public boolean isSetMinAmount() {
368
    return this.minAmount != null;
369
  }
370
 
371
  public void setMinAmountIsSet(boolean value) {
372
    if (!value) {
373
      this.minAmount = null;
374
    }
375
  }
376
 
377
  public String getTenureDescription() {
378
    return this.tenureDescription;
379
  }
380
 
381
  public void setTenureDescription(String tenureDescription) {
382
    this.tenureDescription = tenureDescription;
383
  }
384
 
385
  public void unsetTenureDescription() {
386
    this.tenureDescription = null;
387
  }
388
 
389
  /** Returns true if field tenureDescription is set (has been assigned a value) and false otherwise */
390
  public boolean isSetTenureDescription() {
391
    return this.tenureDescription != null;
392
  }
393
 
394
  public void setTenureDescriptionIsSet(boolean value) {
395
    if (!value) {
396
      this.tenureDescription = null;
397
    }
398
  }
399
 
400
  /**
401
   * 
402
   * @see EmiChargeType
403
   */
404
  public EmiChargeType getChargeType() {
405
    return this.chargeType;
406
  }
407
 
408
  /**
409
   * 
410
   * @see EmiChargeType
411
   */
412
  public void setChargeType(EmiChargeType chargeType) {
413
    this.chargeType = chargeType;
414
  }
415
 
416
  public void unsetChargeType() {
417
    this.chargeType = null;
418
  }
419
 
420
  /** Returns true if field chargeType is set (has been assigned a value) and false otherwise */
421
  public boolean isSetChargeType() {
422
    return this.chargeType != null;
423
  }
424
 
425
  public void setChargeTypeIsSet(boolean value) {
426
    if (!value) {
427
      this.chargeType = null;
428
    }
429
  }
430
 
431
  public long getChargeValue() {
432
    return this.chargeValue;
433
  }
434
 
435
  public void setChargeValue(long chargeValue) {
436
    this.chargeValue = chargeValue;
437
    setChargeValueIsSet(true);
438
  }
439
 
440
  public void unsetChargeValue() {
441
    __isset_bit_vector.clear(__CHARGEVALUE_ISSET_ID);
442
  }
443
 
444
  /** Returns true if field chargeValue is set (has been assigned a value) and false otherwise */
445
  public boolean isSetChargeValue() {
446
    return __isset_bit_vector.get(__CHARGEVALUE_ISSET_ID);
447
  }
448
 
449
  public void setChargeValueIsSet(boolean value) {
450
    __isset_bit_vector.set(__CHARGEVALUE_ISSET_ID, value);
451
  }
452
 
453
  public void setFieldValue(_Fields field, Object value) {
454
    switch (field) {
455
    case ID:
456
      if (value == null) {
457
        unsetId();
458
      } else {
459
        setId((Long)value);
460
      }
461
      break;
462
 
463
    case GATEWAY_ID:
464
      if (value == null) {
465
        unsetGatewayId();
466
      } else {
467
        setGatewayId((Long)value);
468
      }
469
      break;
470
 
471
    case BANK_ID:
472
      if (value == null) {
473
        unsetBankId();
474
      } else {
475
        setBankId((Long)value);
476
      }
477
      break;
478
 
479
    case TENURE:
480
      if (value == null) {
481
        unsetTenure();
482
      } else {
483
        setTenure((Long)value);
484
      }
485
      break;
486
 
487
    case BANK_NAME:
488
      if (value == null) {
489
        unsetBankName();
490
      } else {
491
        setBankName((String)value);
492
      }
493
      break;
494
 
495
    case MIN_AMOUNT:
496
      if (value == null) {
497
        unsetMinAmount();
498
      } else {
499
        setMinAmount((String)value);
500
      }
501
      break;
502
 
503
    case TENURE_DESCRIPTION:
504
      if (value == null) {
505
        unsetTenureDescription();
506
      } else {
507
        setTenureDescription((String)value);
508
      }
509
      break;
510
 
511
    case CHARGE_TYPE:
512
      if (value == null) {
513
        unsetChargeType();
514
      } else {
515
        setChargeType((EmiChargeType)value);
516
      }
517
      break;
518
 
519
    case CHARGE_VALUE:
520
      if (value == null) {
521
        unsetChargeValue();
522
      } else {
523
        setChargeValue((Long)value);
524
      }
525
      break;
526
 
527
    }
528
  }
529
 
530
  public Object getFieldValue(_Fields field) {
531
    switch (field) {
532
    case ID:
533
      return Long.valueOf(getId());
534
 
535
    case GATEWAY_ID:
536
      return Long.valueOf(getGatewayId());
537
 
538
    case BANK_ID:
539
      return Long.valueOf(getBankId());
540
 
541
    case TENURE:
542
      return Long.valueOf(getTenure());
543
 
544
    case BANK_NAME:
545
      return getBankName();
546
 
547
    case MIN_AMOUNT:
548
      return getMinAmount();
549
 
550
    case TENURE_DESCRIPTION:
551
      return getTenureDescription();
552
 
553
    case CHARGE_TYPE:
554
      return getChargeType();
555
 
556
    case CHARGE_VALUE:
557
      return Long.valueOf(getChargeValue());
558
 
559
    }
560
    throw new IllegalStateException();
561
  }
562
 
563
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
564
  public boolean isSet(_Fields field) {
565
    if (field == null) {
566
      throw new IllegalArgumentException();
567
    }
568
 
569
    switch (field) {
570
    case ID:
571
      return isSetId();
572
    case GATEWAY_ID:
573
      return isSetGatewayId();
574
    case BANK_ID:
575
      return isSetBankId();
576
    case TENURE:
577
      return isSetTenure();
578
    case BANK_NAME:
579
      return isSetBankName();
580
    case MIN_AMOUNT:
581
      return isSetMinAmount();
582
    case TENURE_DESCRIPTION:
583
      return isSetTenureDescription();
584
    case CHARGE_TYPE:
585
      return isSetChargeType();
586
    case CHARGE_VALUE:
587
      return isSetChargeValue();
588
    }
589
    throw new IllegalStateException();
590
  }
591
 
592
  @Override
593
  public boolean equals(Object that) {
594
    if (that == null)
595
      return false;
596
    if (that instanceof EmiScheme)
597
      return this.equals((EmiScheme)that);
598
    return false;
599
  }
600
 
601
  public boolean equals(EmiScheme that) {
602
    if (that == null)
603
      return false;
604
 
605
    boolean this_present_id = true;
606
    boolean that_present_id = true;
607
    if (this_present_id || that_present_id) {
608
      if (!(this_present_id && that_present_id))
609
        return false;
610
      if (this.id != that.id)
611
        return false;
612
    }
613
 
614
    boolean this_present_gatewayId = true;
615
    boolean that_present_gatewayId = true;
616
    if (this_present_gatewayId || that_present_gatewayId) {
617
      if (!(this_present_gatewayId && that_present_gatewayId))
618
        return false;
619
      if (this.gatewayId != that.gatewayId)
620
        return false;
621
    }
622
 
623
    boolean this_present_bankId = true;
624
    boolean that_present_bankId = true;
625
    if (this_present_bankId || that_present_bankId) {
626
      if (!(this_present_bankId && that_present_bankId))
627
        return false;
628
      if (this.bankId != that.bankId)
629
        return false;
630
    }
631
 
632
    boolean this_present_tenure = true;
633
    boolean that_present_tenure = true;
634
    if (this_present_tenure || that_present_tenure) {
635
      if (!(this_present_tenure && that_present_tenure))
636
        return false;
637
      if (this.tenure != that.tenure)
638
        return false;
639
    }
640
 
641
    boolean this_present_bankName = true && this.isSetBankName();
642
    boolean that_present_bankName = true && that.isSetBankName();
643
    if (this_present_bankName || that_present_bankName) {
644
      if (!(this_present_bankName && that_present_bankName))
645
        return false;
646
      if (!this.bankName.equals(that.bankName))
647
        return false;
648
    }
649
 
650
    boolean this_present_minAmount = true && this.isSetMinAmount();
651
    boolean that_present_minAmount = true && that.isSetMinAmount();
652
    if (this_present_minAmount || that_present_minAmount) {
653
      if (!(this_present_minAmount && that_present_minAmount))
654
        return false;
655
      if (!this.minAmount.equals(that.minAmount))
656
        return false;
657
    }
658
 
659
    boolean this_present_tenureDescription = true && this.isSetTenureDescription();
660
    boolean that_present_tenureDescription = true && that.isSetTenureDescription();
661
    if (this_present_tenureDescription || that_present_tenureDescription) {
662
      if (!(this_present_tenureDescription && that_present_tenureDescription))
663
        return false;
664
      if (!this.tenureDescription.equals(that.tenureDescription))
665
        return false;
666
    }
667
 
668
    boolean this_present_chargeType = true && this.isSetChargeType();
669
    boolean that_present_chargeType = true && that.isSetChargeType();
670
    if (this_present_chargeType || that_present_chargeType) {
671
      if (!(this_present_chargeType && that_present_chargeType))
672
        return false;
673
      if (!this.chargeType.equals(that.chargeType))
674
        return false;
675
    }
676
 
677
    boolean this_present_chargeValue = true;
678
    boolean that_present_chargeValue = true;
679
    if (this_present_chargeValue || that_present_chargeValue) {
680
      if (!(this_present_chargeValue && that_present_chargeValue))
681
        return false;
682
      if (this.chargeValue != that.chargeValue)
683
        return false;
684
    }
685
 
686
    return true;
687
  }
688
 
689
  @Override
690
  public int hashCode() {
691
    return 0;
692
  }
693
 
694
  public int compareTo(EmiScheme other) {
695
    if (!getClass().equals(other.getClass())) {
696
      return getClass().getName().compareTo(other.getClass().getName());
697
    }
698
 
699
    int lastComparison = 0;
700
    EmiScheme typedOther = (EmiScheme)other;
701
 
702
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
703
    if (lastComparison != 0) {
704
      return lastComparison;
705
    }
706
    if (isSetId()) {
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
708
      if (lastComparison != 0) {
709
        return lastComparison;
710
      }
711
    }
712
    lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(typedOther.isSetGatewayId());
713
    if (lastComparison != 0) {
714
      return lastComparison;
715
    }
716
    if (isSetGatewayId()) {
717
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, typedOther.gatewayId);
718
      if (lastComparison != 0) {
719
        return lastComparison;
720
      }
721
    }
722
    lastComparison = Boolean.valueOf(isSetBankId()).compareTo(typedOther.isSetBankId());
723
    if (lastComparison != 0) {
724
      return lastComparison;
725
    }
726
    if (isSetBankId()) {
727
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bankId, typedOther.bankId);
728
      if (lastComparison != 0) {
729
        return lastComparison;
730
      }
731
    }
732
    lastComparison = Boolean.valueOf(isSetTenure()).compareTo(typedOther.isSetTenure());
733
    if (lastComparison != 0) {
734
      return lastComparison;
735
    }
736
    if (isSetTenure()) {
737
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tenure, typedOther.tenure);
738
      if (lastComparison != 0) {
739
        return lastComparison;
740
      }
741
    }
742
    lastComparison = Boolean.valueOf(isSetBankName()).compareTo(typedOther.isSetBankName());
743
    if (lastComparison != 0) {
744
      return lastComparison;
745
    }
746
    if (isSetBankName()) {
747
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bankName, typedOther.bankName);
748
      if (lastComparison != 0) {
749
        return lastComparison;
750
      }
751
    }
752
    lastComparison = Boolean.valueOf(isSetMinAmount()).compareTo(typedOther.isSetMinAmount());
753
    if (lastComparison != 0) {
754
      return lastComparison;
755
    }
756
    if (isSetMinAmount()) {
757
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minAmount, typedOther.minAmount);
758
      if (lastComparison != 0) {
759
        return lastComparison;
760
      }
761
    }
762
    lastComparison = Boolean.valueOf(isSetTenureDescription()).compareTo(typedOther.isSetTenureDescription());
763
    if (lastComparison != 0) {
764
      return lastComparison;
765
    }
766
    if (isSetTenureDescription()) {
767
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tenureDescription, typedOther.tenureDescription);
768
      if (lastComparison != 0) {
769
        return lastComparison;
770
      }
771
    }
772
    lastComparison = Boolean.valueOf(isSetChargeType()).compareTo(typedOther.isSetChargeType());
773
    if (lastComparison != 0) {
774
      return lastComparison;
775
    }
776
    if (isSetChargeType()) {
777
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chargeType, typedOther.chargeType);
778
      if (lastComparison != 0) {
779
        return lastComparison;
780
      }
781
    }
782
    lastComparison = Boolean.valueOf(isSetChargeValue()).compareTo(typedOther.isSetChargeValue());
783
    if (lastComparison != 0) {
784
      return lastComparison;
785
    }
786
    if (isSetChargeValue()) {
787
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.chargeValue, typedOther.chargeValue);
788
      if (lastComparison != 0) {
789
        return lastComparison;
790
      }
791
    }
792
    return 0;
793
  }
794
 
795
  public _Fields fieldForId(int fieldId) {
796
    return _Fields.findByThriftId(fieldId);
797
  }
798
 
799
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
800
    org.apache.thrift.protocol.TField field;
801
    iprot.readStructBegin();
802
    while (true)
803
    {
804
      field = iprot.readFieldBegin();
805
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
806
        break;
807
      }
808
      switch (field.id) {
809
        case 1: // ID
810
          if (field.type == org.apache.thrift.protocol.TType.I64) {
811
            this.id = iprot.readI64();
812
            setIdIsSet(true);
813
          } else { 
814
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
815
          }
816
          break;
817
        case 2: // GATEWAY_ID
818
          if (field.type == org.apache.thrift.protocol.TType.I64) {
819
            this.gatewayId = iprot.readI64();
820
            setGatewayIdIsSet(true);
821
          } else { 
822
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
823
          }
824
          break;
825
        case 3: // BANK_ID
826
          if (field.type == org.apache.thrift.protocol.TType.I64) {
827
            this.bankId = iprot.readI64();
828
            setBankIdIsSet(true);
829
          } else { 
830
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
831
          }
832
          break;
833
        case 4: // TENURE
834
          if (field.type == org.apache.thrift.protocol.TType.I64) {
835
            this.tenure = iprot.readI64();
836
            setTenureIsSet(true);
837
          } else { 
838
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
839
          }
840
          break;
841
        case 5: // BANK_NAME
842
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
843
            this.bankName = iprot.readString();
844
          } else { 
845
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
846
          }
847
          break;
848
        case 6: // MIN_AMOUNT
849
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
850
            this.minAmount = iprot.readString();
851
          } else { 
852
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
853
          }
854
          break;
855
        case 7: // TENURE_DESCRIPTION
856
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
857
            this.tenureDescription = iprot.readString();
858
          } else { 
859
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
860
          }
861
          break;
862
        case 8: // CHARGE_TYPE
863
          if (field.type == org.apache.thrift.protocol.TType.I32) {
864
            this.chargeType = EmiChargeType.findByValue(iprot.readI32());
865
          } else { 
866
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
867
          }
868
          break;
869
        case 9: // CHARGE_VALUE
870
          if (field.type == org.apache.thrift.protocol.TType.I64) {
871
            this.chargeValue = iprot.readI64();
872
            setChargeValueIsSet(true);
873
          } else { 
874
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
875
          }
876
          break;
877
        default:
878
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
879
      }
880
      iprot.readFieldEnd();
881
    }
882
    iprot.readStructEnd();
883
    validate();
884
  }
885
 
886
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
887
    validate();
888
 
889
    oprot.writeStructBegin(STRUCT_DESC);
890
    oprot.writeFieldBegin(ID_FIELD_DESC);
891
    oprot.writeI64(this.id);
892
    oprot.writeFieldEnd();
893
    oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
894
    oprot.writeI64(this.gatewayId);
895
    oprot.writeFieldEnd();
896
    oprot.writeFieldBegin(BANK_ID_FIELD_DESC);
897
    oprot.writeI64(this.bankId);
898
    oprot.writeFieldEnd();
899
    oprot.writeFieldBegin(TENURE_FIELD_DESC);
900
    oprot.writeI64(this.tenure);
901
    oprot.writeFieldEnd();
902
    if (this.bankName != null) {
903
      oprot.writeFieldBegin(BANK_NAME_FIELD_DESC);
904
      oprot.writeString(this.bankName);
905
      oprot.writeFieldEnd();
906
    }
907
    if (this.minAmount != null) {
908
      oprot.writeFieldBegin(MIN_AMOUNT_FIELD_DESC);
909
      oprot.writeString(this.minAmount);
910
      oprot.writeFieldEnd();
911
    }
912
    if (this.tenureDescription != null) {
913
      oprot.writeFieldBegin(TENURE_DESCRIPTION_FIELD_DESC);
914
      oprot.writeString(this.tenureDescription);
915
      oprot.writeFieldEnd();
916
    }
917
    if (this.chargeType != null) {
918
      oprot.writeFieldBegin(CHARGE_TYPE_FIELD_DESC);
919
      oprot.writeI32(this.chargeType.getValue());
920
      oprot.writeFieldEnd();
921
    }
922
    oprot.writeFieldBegin(CHARGE_VALUE_FIELD_DESC);
923
    oprot.writeI64(this.chargeValue);
924
    oprot.writeFieldEnd();
925
    oprot.writeFieldStop();
926
    oprot.writeStructEnd();
927
  }
928
 
929
  @Override
930
  public String toString() {
931
    StringBuilder sb = new StringBuilder("EmiScheme(");
932
    boolean first = true;
933
 
934
    sb.append("id:");
935
    sb.append(this.id);
936
    first = false;
937
    if (!first) sb.append(", ");
938
    sb.append("gatewayId:");
939
    sb.append(this.gatewayId);
940
    first = false;
941
    if (!first) sb.append(", ");
942
    sb.append("bankId:");
943
    sb.append(this.bankId);
944
    first = false;
945
    if (!first) sb.append(", ");
946
    sb.append("tenure:");
947
    sb.append(this.tenure);
948
    first = false;
949
    if (!first) sb.append(", ");
950
    sb.append("bankName:");
951
    if (this.bankName == null) {
952
      sb.append("null");
953
    } else {
954
      sb.append(this.bankName);
955
    }
956
    first = false;
957
    if (!first) sb.append(", ");
958
    sb.append("minAmount:");
959
    if (this.minAmount == null) {
960
      sb.append("null");
961
    } else {
962
      sb.append(this.minAmount);
963
    }
964
    first = false;
965
    if (!first) sb.append(", ");
966
    sb.append("tenureDescription:");
967
    if (this.tenureDescription == null) {
968
      sb.append("null");
969
    } else {
970
      sb.append(this.tenureDescription);
971
    }
972
    first = false;
973
    if (!first) sb.append(", ");
974
    sb.append("chargeType:");
975
    if (this.chargeType == null) {
976
      sb.append("null");
977
    } else {
978
      sb.append(this.chargeType);
979
    }
980
    first = false;
981
    if (!first) sb.append(", ");
982
    sb.append("chargeValue:");
983
    sb.append(this.chargeValue);
984
    first = false;
985
    sb.append(")");
986
    return sb.toString();
987
  }
988
 
989
  public void validate() throws org.apache.thrift.TException {
990
    // check for required fields
991
  }
992
 
993
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
994
    try {
995
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
996
    } catch (org.apache.thrift.TException te) {
997
      throw new java.io.IOException(te);
998
    }
999
  }
1000
 
1001
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1002
    try {
1003
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1004
      __isset_bit_vector = new BitSet(1);
1005
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1006
    } catch (org.apache.thrift.TException te) {
1007
      throw new java.io.IOException(te);
1008
    }
1009
  }
1010
 
1011
}
1012