Subversion Repositories SmartDukaan

Rev

Rev 19973 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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