Subversion Repositories SmartDukaan

Rev

Rev 6392 | Go to most recent revision | 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);
6389 rajveer 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
6392 amit.gupta 41
  private long minAmount; // required
6389 rajveer 42
  private String tenureDescription; // required
43
  private EmiChargeType chargeType; // required
6410 rajveer 44
  private double chargeValue; // required
6389 rajveer 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;
6392 amit.gupta 137
  private static final int __MINAMOUNT_ISSET_ID = 4;
138
  private static final int __CHARGEVALUE_ISSET_ID = 5;
139
  private BitSet __isset_bit_vector = new BitSet(6);
6389 rajveer 140
 
141
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
142
  static {
143
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
144
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
146
    tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
148
    tmpMap.put(_Fields.BANK_ID, new org.apache.thrift.meta_data.FieldMetaData("bankId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
150
    tmpMap.put(_Fields.TENURE, new org.apache.thrift.meta_data.FieldMetaData("tenure", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
152
    tmpMap.put(_Fields.BANK_NAME, new org.apache.thrift.meta_data.FieldMetaData("bankName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
153
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
154
    tmpMap.put(_Fields.MIN_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("minAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6392 amit.gupta 155
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6389 rajveer 156
    tmpMap.put(_Fields.TENURE_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("tenureDescription", org.apache.thrift.TFieldRequirementType.DEFAULT, 
157
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
158
    tmpMap.put(_Fields.CHARGE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("chargeType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
159
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, EmiChargeType.class)));
160
    tmpMap.put(_Fields.CHARGE_VALUE, new org.apache.thrift.meta_data.FieldMetaData("chargeValue", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6410 rajveer 161
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
6389 rajveer 162
    metaDataMap = Collections.unmodifiableMap(tmpMap);
163
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(EmiScheme.class, metaDataMap);
164
  }
165
 
166
  public EmiScheme() {
167
  }
168
 
169
  public EmiScheme(
170
    long id,
171
    long gatewayId,
172
    long bankId,
173
    long tenure,
174
    String bankName,
6392 amit.gupta 175
    long minAmount,
6389 rajveer 176
    String tenureDescription,
177
    EmiChargeType chargeType,
6410 rajveer 178
    double chargeValue)
6389 rajveer 179
  {
180
    this();
181
    this.id = id;
182
    setIdIsSet(true);
183
    this.gatewayId = gatewayId;
184
    setGatewayIdIsSet(true);
185
    this.bankId = bankId;
186
    setBankIdIsSet(true);
187
    this.tenure = tenure;
188
    setTenureIsSet(true);
189
    this.bankName = bankName;
190
    this.minAmount = minAmount;
6392 amit.gupta 191
    setMinAmountIsSet(true);
6389 rajveer 192
    this.tenureDescription = tenureDescription;
193
    this.chargeType = chargeType;
194
    this.chargeValue = chargeValue;
195
    setChargeValueIsSet(true);
196
  }
197
 
198
  /**
199
   * Performs a deep copy on <i>other</i>.
200
   */
201
  public EmiScheme(EmiScheme other) {
202
    __isset_bit_vector.clear();
203
    __isset_bit_vector.or(other.__isset_bit_vector);
204
    this.id = other.id;
205
    this.gatewayId = other.gatewayId;
206
    this.bankId = other.bankId;
207
    this.tenure = other.tenure;
208
    if (other.isSetBankName()) {
209
      this.bankName = other.bankName;
210
    }
6392 amit.gupta 211
    this.minAmount = other.minAmount;
6389 rajveer 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;
6392 amit.gupta 236
    setMinAmountIsSet(false);
237
    this.minAmount = 0;
6389 rajveer 238
    this.tenureDescription = null;
239
    this.chargeType = null;
240
    setChargeValueIsSet(false);
6410 rajveer 241
    this.chargeValue = 0.0;
6389 rajveer 242
  }
243
 
244
  public long getId() {
245
    return this.id;
246
  }
247
 
248
  public void setId(long id) {
249
    this.id = id;
250
    setIdIsSet(true);
251
  }
252
 
253
  public void unsetId() {
254
    __isset_bit_vector.clear(__ID_ISSET_ID);
255
  }
256
 
257
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
258
  public boolean isSetId() {
259
    return __isset_bit_vector.get(__ID_ISSET_ID);
260
  }
261
 
262
  public void setIdIsSet(boolean value) {
263
    __isset_bit_vector.set(__ID_ISSET_ID, value);
264
  }
265
 
266
  public long getGatewayId() {
267
    return this.gatewayId;
268
  }
269
 
270
  public void setGatewayId(long gatewayId) {
271
    this.gatewayId = gatewayId;
272
    setGatewayIdIsSet(true);
273
  }
274
 
275
  public void unsetGatewayId() {
276
    __isset_bit_vector.clear(__GATEWAYID_ISSET_ID);
277
  }
278
 
279
  /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
280
  public boolean isSetGatewayId() {
281
    return __isset_bit_vector.get(__GATEWAYID_ISSET_ID);
282
  }
283
 
284
  public void setGatewayIdIsSet(boolean value) {
285
    __isset_bit_vector.set(__GATEWAYID_ISSET_ID, value);
286
  }
287
 
288
  public long getBankId() {
289
    return this.bankId;
290
  }
291
 
292
  public void setBankId(long bankId) {
293
    this.bankId = bankId;
294
    setBankIdIsSet(true);
295
  }
296
 
297
  public void unsetBankId() {
298
    __isset_bit_vector.clear(__BANKID_ISSET_ID);
299
  }
300
 
301
  /** Returns true if field bankId is set (has been assigned a value) and false otherwise */
302
  public boolean isSetBankId() {
303
    return __isset_bit_vector.get(__BANKID_ISSET_ID);
304
  }
305
 
306
  public void setBankIdIsSet(boolean value) {
307
    __isset_bit_vector.set(__BANKID_ISSET_ID, value);
308
  }
309
 
310
  public long getTenure() {
311
    return this.tenure;
312
  }
313
 
314
  public void setTenure(long tenure) {
315
    this.tenure = tenure;
316
    setTenureIsSet(true);
317
  }
318
 
319
  public void unsetTenure() {
320
    __isset_bit_vector.clear(__TENURE_ISSET_ID);
321
  }
322
 
323
  /** Returns true if field tenure is set (has been assigned a value) and false otherwise */
324
  public boolean isSetTenure() {
325
    return __isset_bit_vector.get(__TENURE_ISSET_ID);
326
  }
327
 
328
  public void setTenureIsSet(boolean value) {
329
    __isset_bit_vector.set(__TENURE_ISSET_ID, value);
330
  }
331
 
332
  public String getBankName() {
333
    return this.bankName;
334
  }
335
 
336
  public void setBankName(String bankName) {
337
    this.bankName = bankName;
338
  }
339
 
340
  public void unsetBankName() {
341
    this.bankName = null;
342
  }
343
 
344
  /** Returns true if field bankName is set (has been assigned a value) and false otherwise */
345
  public boolean isSetBankName() {
346
    return this.bankName != null;
347
  }
348
 
349
  public void setBankNameIsSet(boolean value) {
350
    if (!value) {
351
      this.bankName = null;
352
    }
353
  }
354
 
6392 amit.gupta 355
  public long getMinAmount() {
6389 rajveer 356
    return this.minAmount;
357
  }
358
 
6392 amit.gupta 359
  public void setMinAmount(long minAmount) {
6389 rajveer 360
    this.minAmount = minAmount;
6392 amit.gupta 361
    setMinAmountIsSet(true);
6389 rajveer 362
  }
363
 
364
  public void unsetMinAmount() {
6392 amit.gupta 365
    __isset_bit_vector.clear(__MINAMOUNT_ISSET_ID);
6389 rajveer 366
  }
367
 
368
  /** Returns true if field minAmount is set (has been assigned a value) and false otherwise */
369
  public boolean isSetMinAmount() {
6392 amit.gupta 370
    return __isset_bit_vector.get(__MINAMOUNT_ISSET_ID);
6389 rajveer 371
  }
372
 
373
  public void setMinAmountIsSet(boolean value) {
6392 amit.gupta 374
    __isset_bit_vector.set(__MINAMOUNT_ISSET_ID, value);
6389 rajveer 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
 
6410 rajveer 431
  public double getChargeValue() {
6389 rajveer 432
    return this.chargeValue;
433
  }
434
 
6410 rajveer 435
  public void setChargeValue(double chargeValue) {
6389 rajveer 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 {
6392 amit.gupta 499
        setMinAmount((Long)value);
6389 rajveer 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 {
6410 rajveer 523
        setChargeValue((Double)value);
6389 rajveer 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:
6392 amit.gupta 548
      return Long.valueOf(getMinAmount());
6389 rajveer 549
 
550
    case TENURE_DESCRIPTION:
551
      return getTenureDescription();
552
 
553
    case CHARGE_TYPE:
554
      return getChargeType();
555
 
556
    case CHARGE_VALUE:
6410 rajveer 557
      return Double.valueOf(getChargeValue());
6389 rajveer 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
 
6392 amit.gupta 650
    boolean this_present_minAmount = true;
651
    boolean that_present_minAmount = true;
6389 rajveer 652
    if (this_present_minAmount || that_present_minAmount) {
653
      if (!(this_present_minAmount && that_present_minAmount))
654
        return false;
6392 amit.gupta 655
      if (this.minAmount != that.minAmount)
6389 rajveer 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
6392 amit.gupta 849
          if (field.type == org.apache.thrift.protocol.TType.I64) {
850
            this.minAmount = iprot.readI64();
851
            setMinAmountIsSet(true);
6389 rajveer 852
          } else { 
853
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
854
          }
855
          break;
856
        case 7: // TENURE_DESCRIPTION
857
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
858
            this.tenureDescription = iprot.readString();
859
          } else { 
860
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
861
          }
862
          break;
863
        case 8: // CHARGE_TYPE
864
          if (field.type == org.apache.thrift.protocol.TType.I32) {
865
            this.chargeType = EmiChargeType.findByValue(iprot.readI32());
866
          } else { 
867
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
868
          }
869
          break;
870
        case 9: // CHARGE_VALUE
6410 rajveer 871
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
872
            this.chargeValue = iprot.readDouble();
6389 rajveer 873
            setChargeValueIsSet(true);
874
          } else { 
875
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
876
          }
877
          break;
878
        default:
879
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
880
      }
881
      iprot.readFieldEnd();
882
    }
883
    iprot.readStructEnd();
884
    validate();
885
  }
886
 
887
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
888
    validate();
889
 
890
    oprot.writeStructBegin(STRUCT_DESC);
891
    oprot.writeFieldBegin(ID_FIELD_DESC);
892
    oprot.writeI64(this.id);
893
    oprot.writeFieldEnd();
894
    oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
895
    oprot.writeI64(this.gatewayId);
896
    oprot.writeFieldEnd();
897
    oprot.writeFieldBegin(BANK_ID_FIELD_DESC);
898
    oprot.writeI64(this.bankId);
899
    oprot.writeFieldEnd();
900
    oprot.writeFieldBegin(TENURE_FIELD_DESC);
901
    oprot.writeI64(this.tenure);
902
    oprot.writeFieldEnd();
903
    if (this.bankName != null) {
904
      oprot.writeFieldBegin(BANK_NAME_FIELD_DESC);
905
      oprot.writeString(this.bankName);
906
      oprot.writeFieldEnd();
907
    }
6392 amit.gupta 908
    oprot.writeFieldBegin(MIN_AMOUNT_FIELD_DESC);
909
    oprot.writeI64(this.minAmount);
910
    oprot.writeFieldEnd();
6389 rajveer 911
    if (this.tenureDescription != null) {
912
      oprot.writeFieldBegin(TENURE_DESCRIPTION_FIELD_DESC);
913
      oprot.writeString(this.tenureDescription);
914
      oprot.writeFieldEnd();
915
    }
916
    if (this.chargeType != null) {
917
      oprot.writeFieldBegin(CHARGE_TYPE_FIELD_DESC);
918
      oprot.writeI32(this.chargeType.getValue());
919
      oprot.writeFieldEnd();
920
    }
921
    oprot.writeFieldBegin(CHARGE_VALUE_FIELD_DESC);
6410 rajveer 922
    oprot.writeDouble(this.chargeValue);
6389 rajveer 923
    oprot.writeFieldEnd();
924
    oprot.writeFieldStop();
925
    oprot.writeStructEnd();
926
  }
927
 
928
  @Override
929
  public String toString() {
930
    StringBuilder sb = new StringBuilder("EmiScheme(");
931
    boolean first = true;
932
 
933
    sb.append("id:");
934
    sb.append(this.id);
935
    first = false;
936
    if (!first) sb.append(", ");
937
    sb.append("gatewayId:");
938
    sb.append(this.gatewayId);
939
    first = false;
940
    if (!first) sb.append(", ");
941
    sb.append("bankId:");
942
    sb.append(this.bankId);
943
    first = false;
944
    if (!first) sb.append(", ");
945
    sb.append("tenure:");
946
    sb.append(this.tenure);
947
    first = false;
948
    if (!first) sb.append(", ");
949
    sb.append("bankName:");
950
    if (this.bankName == null) {
951
      sb.append("null");
952
    } else {
953
      sb.append(this.bankName);
954
    }
955
    first = false;
956
    if (!first) sb.append(", ");
957
    sb.append("minAmount:");
6392 amit.gupta 958
    sb.append(this.minAmount);
6389 rajveer 959
    first = false;
960
    if (!first) sb.append(", ");
961
    sb.append("tenureDescription:");
962
    if (this.tenureDescription == null) {
963
      sb.append("null");
964
    } else {
965
      sb.append(this.tenureDescription);
966
    }
967
    first = false;
968
    if (!first) sb.append(", ");
969
    sb.append("chargeType:");
970
    if (this.chargeType == null) {
971
      sb.append("null");
972
    } else {
973
      sb.append(this.chargeType);
974
    }
975
    first = false;
976
    if (!first) sb.append(", ");
977
    sb.append("chargeValue:");
978
    sb.append(this.chargeValue);
979
    first = false;
980
    sb.append(")");
981
    return sb.toString();
982
  }
983
 
984
  public void validate() throws org.apache.thrift.TException {
985
    // check for required fields
986
  }
987
 
988
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
989
    try {
990
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
991
    } catch (org.apache.thrift.TException te) {
992
      throw new java.io.IOException(te);
993
    }
994
  }
995
 
996
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
997
    try {
998
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
999
      __isset_bit_vector = new BitSet(1);
1000
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1001
    } catch (org.apache.thrift.TException te) {
1002
      throw new java.io.IOException(te);
1003
    }
1004
  }
1005
 
1006
}
1007