Subversion Repositories SmartDukaan

Rev

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

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