Subversion Repositories SmartDukaan

Rev

Rev 20025 | Rev 20065 | Go to most recent revision | Details | Compare with Previous | 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);
20043 amit.gupta 33
  private static final org.apache.thrift.protocol.TField ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("address", org.apache.thrift.protocol.TType.STRING, (short)8);
20025 amit.gupta 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
20043 amit.gupta 43
  private String address; // required
20025 amit.gupta 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;
20043 amit.gupta 131
  private static final int __STATEID_ISSET_ID = 2;
132
  private BitSet __isset_bit_vector = new BitSet(3);
20025 amit.gupta 133
 
134
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
135
  static {
136
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
137
    tmpMap.put(_Fields.BUYER_ID, new org.apache.thrift.meta_data.FieldMetaData("buyerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
138
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
139
    tmpMap.put(_Fields.ORGANISATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("organisationName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
140
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
141
    tmpMap.put(_Fields.REGISTERED_ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("registeredAddress", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
143
    tmpMap.put(_Fields.REG_ID, new org.apache.thrift.meta_data.FieldMetaData("regId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
145
    tmpMap.put(_Fields.CIN_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("cinNumber", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
147
    tmpMap.put(_Fields.TIN, new org.apache.thrift.meta_data.FieldMetaData("tin", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
149
    tmpMap.put(_Fields.ADDRESS_ID, new org.apache.thrift.meta_data.FieldMetaData("addressId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
151
    tmpMap.put(_Fields.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.DEFAULT, 
20043 amit.gupta 152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
20025 amit.gupta 153
    tmpMap.put(_Fields.STATE_ID, new org.apache.thrift.meta_data.FieldMetaData("stateId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
155
    metaDataMap = Collections.unmodifiableMap(tmpMap);
156
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BuyerInfo.class, metaDataMap);
157
  }
158
 
159
  public BuyerInfo() {
160
  }
161
 
162
  public BuyerInfo(
163
    long buyerId,
164
    String organisationName,
165
    String registeredAddress,
166
    String regId,
167
    String cinNumber,
168
    String tin,
169
    long addressId,
20043 amit.gupta 170
    String address,
20025 amit.gupta 171
    long stateId)
172
  {
173
    this();
174
    this.buyerId = buyerId;
175
    setBuyerIdIsSet(true);
176
    this.organisationName = organisationName;
177
    this.registeredAddress = registeredAddress;
178
    this.regId = regId;
179
    this.cinNumber = cinNumber;
180
    this.tin = tin;
181
    this.addressId = addressId;
182
    setAddressIdIsSet(true);
183
    this.address = address;
184
    this.stateId = stateId;
185
    setStateIdIsSet(true);
186
  }
187
 
188
  /**
189
   * Performs a deep copy on <i>other</i>.
190
   */
191
  public BuyerInfo(BuyerInfo other) {
192
    __isset_bit_vector.clear();
193
    __isset_bit_vector.or(other.__isset_bit_vector);
194
    this.buyerId = other.buyerId;
195
    if (other.isSetOrganisationName()) {
196
      this.organisationName = other.organisationName;
197
    }
198
    if (other.isSetRegisteredAddress()) {
199
      this.registeredAddress = other.registeredAddress;
200
    }
201
    if (other.isSetRegId()) {
202
      this.regId = other.regId;
203
    }
204
    if (other.isSetCinNumber()) {
205
      this.cinNumber = other.cinNumber;
206
    }
207
    if (other.isSetTin()) {
208
      this.tin = other.tin;
209
    }
210
    this.addressId = other.addressId;
20043 amit.gupta 211
    if (other.isSetAddress()) {
212
      this.address = other.address;
213
    }
20025 amit.gupta 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;
20043 amit.gupta 232
    this.address = null;
20025 amit.gupta 233
    setStateIdIsSet(false);
234
    this.stateId = 0;
235
  }
236
 
237
  public long getBuyerId() {
238
    return this.buyerId;
239
  }
240
 
241
  public void setBuyerId(long buyerId) {
242
    this.buyerId = buyerId;
243
    setBuyerIdIsSet(true);
244
  }
245
 
246
  public void unsetBuyerId() {
247
    __isset_bit_vector.clear(__BUYERID_ISSET_ID);
248
  }
249
 
250
  /** Returns true if field buyerId is set (has been assigned a value) and false otherwise */
251
  public boolean isSetBuyerId() {
252
    return __isset_bit_vector.get(__BUYERID_ISSET_ID);
253
  }
254
 
255
  public void setBuyerIdIsSet(boolean value) {
256
    __isset_bit_vector.set(__BUYERID_ISSET_ID, value);
257
  }
258
 
259
  public String getOrganisationName() {
260
    return this.organisationName;
261
  }
262
 
263
  public void setOrganisationName(String organisationName) {
264
    this.organisationName = organisationName;
265
  }
266
 
267
  public void unsetOrganisationName() {
268
    this.organisationName = null;
269
  }
270
 
271
  /** Returns true if field organisationName is set (has been assigned a value) and false otherwise */
272
  public boolean isSetOrganisationName() {
273
    return this.organisationName != null;
274
  }
275
 
276
  public void setOrganisationNameIsSet(boolean value) {
277
    if (!value) {
278
      this.organisationName = null;
279
    }
280
  }
281
 
282
  public String getRegisteredAddress() {
283
    return this.registeredAddress;
284
  }
285
 
286
  public void setRegisteredAddress(String registeredAddress) {
287
    this.registeredAddress = registeredAddress;
288
  }
289
 
290
  public void unsetRegisteredAddress() {
291
    this.registeredAddress = null;
292
  }
293
 
294
  /** Returns true if field registeredAddress is set (has been assigned a value) and false otherwise */
295
  public boolean isSetRegisteredAddress() {
296
    return this.registeredAddress != null;
297
  }
298
 
299
  public void setRegisteredAddressIsSet(boolean value) {
300
    if (!value) {
301
      this.registeredAddress = null;
302
    }
303
  }
304
 
305
  public String getRegId() {
306
    return this.regId;
307
  }
308
 
309
  public void setRegId(String regId) {
310
    this.regId = regId;
311
  }
312
 
313
  public void unsetRegId() {
314
    this.regId = null;
315
  }
316
 
317
  /** Returns true if field regId is set (has been assigned a value) and false otherwise */
318
  public boolean isSetRegId() {
319
    return this.regId != null;
320
  }
321
 
322
  public void setRegIdIsSet(boolean value) {
323
    if (!value) {
324
      this.regId = null;
325
    }
326
  }
327
 
328
  public String getCinNumber() {
329
    return this.cinNumber;
330
  }
331
 
332
  public void setCinNumber(String cinNumber) {
333
    this.cinNumber = cinNumber;
334
  }
335
 
336
  public void unsetCinNumber() {
337
    this.cinNumber = null;
338
  }
339
 
340
  /** Returns true if field cinNumber is set (has been assigned a value) and false otherwise */
341
  public boolean isSetCinNumber() {
342
    return this.cinNumber != null;
343
  }
344
 
345
  public void setCinNumberIsSet(boolean value) {
346
    if (!value) {
347
      this.cinNumber = null;
348
    }
349
  }
350
 
351
  public String getTin() {
352
    return this.tin;
353
  }
354
 
355
  public void setTin(String tin) {
356
    this.tin = tin;
357
  }
358
 
359
  public void unsetTin() {
360
    this.tin = null;
361
  }
362
 
363
  /** Returns true if field tin is set (has been assigned a value) and false otherwise */
364
  public boolean isSetTin() {
365
    return this.tin != null;
366
  }
367
 
368
  public void setTinIsSet(boolean value) {
369
    if (!value) {
370
      this.tin = null;
371
    }
372
  }
373
 
374
  public long getAddressId() {
375
    return this.addressId;
376
  }
377
 
378
  public void setAddressId(long addressId) {
379
    this.addressId = addressId;
380
    setAddressIdIsSet(true);
381
  }
382
 
383
  public void unsetAddressId() {
384
    __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
385
  }
386
 
387
  /** Returns true if field addressId is set (has been assigned a value) and false otherwise */
388
  public boolean isSetAddressId() {
389
    return __isset_bit_vector.get(__ADDRESSID_ISSET_ID);
390
  }
391
 
392
  public void setAddressIdIsSet(boolean value) {
393
    __isset_bit_vector.set(__ADDRESSID_ISSET_ID, value);
394
  }
395
 
20043 amit.gupta 396
  public String getAddress() {
20025 amit.gupta 397
    return this.address;
398
  }
399
 
20043 amit.gupta 400
  public void setAddress(String address) {
20025 amit.gupta 401
    this.address = address;
402
  }
403
 
404
  public void unsetAddress() {
20043 amit.gupta 405
    this.address = null;
20025 amit.gupta 406
  }
407
 
408
  /** Returns true if field address is set (has been assigned a value) and false otherwise */
409
  public boolean isSetAddress() {
20043 amit.gupta 410
    return this.address != null;
20025 amit.gupta 411
  }
412
 
413
  public void setAddressIsSet(boolean value) {
20043 amit.gupta 414
    if (!value) {
415
      this.address = null;
416
    }
20025 amit.gupta 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 {
20043 amit.gupta 503
        setAddress((String)value);
20025 amit.gupta 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:
20043 amit.gupta 542
      return getAddress();
20025 amit.gupta 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
 
20043 amit.gupta 656
    boolean this_present_address = true && this.isSetAddress();
657
    boolean that_present_address = true && that.isSetAddress();
20025 amit.gupta 658
    if (this_present_address || that_present_address) {
659
      if (!(this_present_address && that_present_address))
660
        return false;
20043 amit.gupta 661
      if (!this.address.equals(that.address))
20025 amit.gupta 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
20043 amit.gupta 849
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
850
            this.address = iprot.readString();
20025 amit.gupta 851
          } else { 
852
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
853
          }
854
          break;
855
        case 9: // STATE_ID
856
          if (field.type == org.apache.thrift.protocol.TType.I64) {
857
            this.stateId = iprot.readI64();
858
            setStateIdIsSet(true);
859
          } else { 
860
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
861
          }
862
          break;
863
        default:
864
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
865
      }
866
      iprot.readFieldEnd();
867
    }
868
    iprot.readStructEnd();
869
    validate();
870
  }
871
 
872
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
873
    validate();
874
 
875
    oprot.writeStructBegin(STRUCT_DESC);
876
    oprot.writeFieldBegin(BUYER_ID_FIELD_DESC);
877
    oprot.writeI64(this.buyerId);
878
    oprot.writeFieldEnd();
879
    if (this.organisationName != null) {
880
      oprot.writeFieldBegin(ORGANISATION_NAME_FIELD_DESC);
881
      oprot.writeString(this.organisationName);
882
      oprot.writeFieldEnd();
883
    }
884
    if (this.registeredAddress != null) {
885
      oprot.writeFieldBegin(REGISTERED_ADDRESS_FIELD_DESC);
886
      oprot.writeString(this.registeredAddress);
887
      oprot.writeFieldEnd();
888
    }
889
    if (this.regId != null) {
890
      oprot.writeFieldBegin(REG_ID_FIELD_DESC);
891
      oprot.writeString(this.regId);
892
      oprot.writeFieldEnd();
893
    }
894
    if (this.cinNumber != null) {
895
      oprot.writeFieldBegin(CIN_NUMBER_FIELD_DESC);
896
      oprot.writeString(this.cinNumber);
897
      oprot.writeFieldEnd();
898
    }
899
    if (this.tin != null) {
900
      oprot.writeFieldBegin(TIN_FIELD_DESC);
901
      oprot.writeString(this.tin);
902
      oprot.writeFieldEnd();
903
    }
904
    oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
905
    oprot.writeI64(this.addressId);
906
    oprot.writeFieldEnd();
20043 amit.gupta 907
    if (this.address != null) {
908
      oprot.writeFieldBegin(ADDRESS_FIELD_DESC);
909
      oprot.writeString(this.address);
910
      oprot.writeFieldEnd();
911
    }
20025 amit.gupta 912
    oprot.writeFieldBegin(STATE_ID_FIELD_DESC);
913
    oprot.writeI64(this.stateId);
914
    oprot.writeFieldEnd();
915
    oprot.writeFieldStop();
916
    oprot.writeStructEnd();
917
  }
918
 
919
  @Override
920
  public String toString() {
921
    StringBuilder sb = new StringBuilder("BuyerInfo(");
922
    boolean first = true;
923
 
924
    sb.append("buyerId:");
925
    sb.append(this.buyerId);
926
    first = false;
927
    if (!first) sb.append(", ");
928
    sb.append("organisationName:");
929
    if (this.organisationName == null) {
930
      sb.append("null");
931
    } else {
932
      sb.append(this.organisationName);
933
    }
934
    first = false;
935
    if (!first) sb.append(", ");
936
    sb.append("registeredAddress:");
937
    if (this.registeredAddress == null) {
938
      sb.append("null");
939
    } else {
940
      sb.append(this.registeredAddress);
941
    }
942
    first = false;
943
    if (!first) sb.append(", ");
944
    sb.append("regId:");
945
    if (this.regId == null) {
946
      sb.append("null");
947
    } else {
948
      sb.append(this.regId);
949
    }
950
    first = false;
951
    if (!first) sb.append(", ");
952
    sb.append("cinNumber:");
953
    if (this.cinNumber == null) {
954
      sb.append("null");
955
    } else {
956
      sb.append(this.cinNumber);
957
    }
958
    first = false;
959
    if (!first) sb.append(", ");
960
    sb.append("tin:");
961
    if (this.tin == null) {
962
      sb.append("null");
963
    } else {
964
      sb.append(this.tin);
965
    }
966
    first = false;
967
    if (!first) sb.append(", ");
968
    sb.append("addressId:");
969
    sb.append(this.addressId);
970
    first = false;
971
    if (!first) sb.append(", ");
972
    sb.append("address:");
20043 amit.gupta 973
    if (this.address == null) {
974
      sb.append("null");
975
    } else {
976
      sb.append(this.address);
977
    }
20025 amit.gupta 978
    first = false;
979
    if (!first) sb.append(", ");
980
    sb.append("stateId:");
981
    sb.append(this.stateId);
982
    first = false;
983
    sb.append(")");
984
    return sb.toString();
985
  }
986
 
987
  public void validate() throws org.apache.thrift.TException {
988
    // check for required fields
989
  }
990
 
991
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
992
    try {
993
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
994
    } catch (org.apache.thrift.TException te) {
995
      throw new java.io.IOException(te);
996
    }
997
  }
998
 
999
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1000
    try {
1001
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1002
      __isset_bit_vector = new BitSet(1);
1003
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1004
    } catch (org.apache.thrift.TException te) {
1005
      throw new java.io.IOException(te);
1006
    }
1007
  }
1008
 
1009
}
1010