Subversion Repositories SmartDukaan

Rev

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

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