Subversion Repositories SmartDukaan

Rev

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