Subversion Repositories SmartDukaan

Rev

Rev 12280 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12280 Rev 21838
Line 24... Line 24...
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StateInfo");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StateInfo");
25
 
25
 
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField STATE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("stateName", org.apache.thrift.protocol.TType.STRING, (short)2);
27
  private static final org.apache.thrift.protocol.TField STATE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("stateName", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField VAT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("vatType", org.apache.thrift.protocol.TType.I32, (short)3);
28
  private static final org.apache.thrift.protocol.TField VAT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("vatType", org.apache.thrift.protocol.TType.I32, (short)3);
-
 
29
  private static final org.apache.thrift.protocol.TField STATE_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("stateCode", org.apache.thrift.protocol.TType.STRING, (short)4);
29
 
30
 
30
  private long id; // required
31
  private long id; // required
31
  private String stateName; // required
32
  private String stateName; // required
32
  private VatType vatType; // required
33
  private VatType vatType; // required
-
 
34
  private String stateCode; // required
33
 
35
 
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
37
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
36
    ID((short)1, "id"),
38
    ID((short)1, "id"),
37
    STATE_NAME((short)2, "stateName"),
39
    STATE_NAME((short)2, "stateName"),
38
    /**
40
    /**
39
     * 
41
     * 
40
     * @see VatType
42
     * @see VatType
41
     */
43
     */
42
    VAT_TYPE((short)3, "vatType");
44
    VAT_TYPE((short)3, "vatType"),
-
 
45
    STATE_CODE((short)4, "stateCode");
43
 
46
 
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
45
 
48
 
46
    static {
49
    static {
47
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
50
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 58... Line 61...
58
          return ID;
61
          return ID;
59
        case 2: // STATE_NAME
62
        case 2: // STATE_NAME
60
          return STATE_NAME;
63
          return STATE_NAME;
61
        case 3: // VAT_TYPE
64
        case 3: // VAT_TYPE
62
          return VAT_TYPE;
65
          return VAT_TYPE;
-
 
66
        case 4: // STATE_CODE
-
 
67
          return STATE_CODE;
63
        default:
68
        default:
64
          return null;
69
          return null;
65
      }
70
      }
66
    }
71
    }
67
 
72
 
Line 110... Line 115...
110
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
115
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
111
    tmpMap.put(_Fields.STATE_NAME, new org.apache.thrift.meta_data.FieldMetaData("stateName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
116
    tmpMap.put(_Fields.STATE_NAME, new org.apache.thrift.meta_data.FieldMetaData("stateName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
112
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
117
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
113
    tmpMap.put(_Fields.VAT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("vatType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
118
    tmpMap.put(_Fields.VAT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("vatType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
114
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VatType.class)));
119
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VatType.class)));
-
 
120
    tmpMap.put(_Fields.STATE_CODE, new org.apache.thrift.meta_data.FieldMetaData("stateCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
121
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
115
    metaDataMap = Collections.unmodifiableMap(tmpMap);
122
    metaDataMap = Collections.unmodifiableMap(tmpMap);
116
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StateInfo.class, metaDataMap);
123
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StateInfo.class, metaDataMap);
117
  }
124
  }
118
 
125
 
119
  public StateInfo() {
126
  public StateInfo() {
120
  }
127
  }
121
 
128
 
122
  public StateInfo(
129
  public StateInfo(
123
    long id,
130
    long id,
124
    String stateName,
131
    String stateName,
125
    VatType vatType)
132
    VatType vatType,
-
 
133
    String stateCode)
126
  {
134
  {
127
    this();
135
    this();
128
    this.id = id;
136
    this.id = id;
129
    setIdIsSet(true);
137
    setIdIsSet(true);
130
    this.stateName = stateName;
138
    this.stateName = stateName;
131
    this.vatType = vatType;
139
    this.vatType = vatType;
-
 
140
    this.stateCode = stateCode;
132
  }
141
  }
133
 
142
 
134
  /**
143
  /**
135
   * Performs a deep copy on <i>other</i>.
144
   * Performs a deep copy on <i>other</i>.
136
   */
145
   */
Line 142... Line 151...
142
      this.stateName = other.stateName;
151
      this.stateName = other.stateName;
143
    }
152
    }
144
    if (other.isSetVatType()) {
153
    if (other.isSetVatType()) {
145
      this.vatType = other.vatType;
154
      this.vatType = other.vatType;
146
    }
155
    }
-
 
156
    if (other.isSetStateCode()) {
-
 
157
      this.stateCode = other.stateCode;
-
 
158
    }
147
  }
159
  }
148
 
160
 
149
  public StateInfo deepCopy() {
161
  public StateInfo deepCopy() {
150
    return new StateInfo(this);
162
    return new StateInfo(this);
151
  }
163
  }
Line 154... Line 166...
154
  public void clear() {
166
  public void clear() {
155
    setIdIsSet(false);
167
    setIdIsSet(false);
156
    this.id = 0;
168
    this.id = 0;
157
    this.stateName = null;
169
    this.stateName = null;
158
    this.vatType = null;
170
    this.vatType = null;
-
 
171
    this.stateCode = null;
159
  }
172
  }
160
 
173
 
161
  public long getId() {
174
  public long getId() {
162
    return this.id;
175
    return this.id;
163
  }
176
  }
Line 232... Line 245...
232
    if (!value) {
245
    if (!value) {
233
      this.vatType = null;
246
      this.vatType = null;
234
    }
247
    }
235
  }
248
  }
236
 
249
 
-
 
250
  public String getStateCode() {
-
 
251
    return this.stateCode;
-
 
252
  }
-
 
253
 
-
 
254
  public void setStateCode(String stateCode) {
-
 
255
    this.stateCode = stateCode;
-
 
256
  }
-
 
257
 
-
 
258
  public void unsetStateCode() {
-
 
259
    this.stateCode = null;
-
 
260
  }
-
 
261
 
-
 
262
  /** Returns true if field stateCode is set (has been assigned a value) and false otherwise */
-
 
263
  public boolean isSetStateCode() {
-
 
264
    return this.stateCode != null;
-
 
265
  }
-
 
266
 
-
 
267
  public void setStateCodeIsSet(boolean value) {
-
 
268
    if (!value) {
-
 
269
      this.stateCode = null;
-
 
270
    }
-
 
271
  }
-
 
272
 
237
  public void setFieldValue(_Fields field, Object value) {
273
  public void setFieldValue(_Fields field, Object value) {
238
    switch (field) {
274
    switch (field) {
239
    case ID:
275
    case ID:
240
      if (value == null) {
276
      if (value == null) {
241
        unsetId();
277
        unsetId();
Line 258... Line 294...
258
      } else {
294
      } else {
259
        setVatType((VatType)value);
295
        setVatType((VatType)value);
260
      }
296
      }
261
      break;
297
      break;
262
 
298
 
-
 
299
    case STATE_CODE:
-
 
300
      if (value == null) {
-
 
301
        unsetStateCode();
-
 
302
      } else {
-
 
303
        setStateCode((String)value);
-
 
304
      }
-
 
305
      break;
-
 
306
 
263
    }
307
    }
264
  }
308
  }
265
 
309
 
266
  public Object getFieldValue(_Fields field) {
310
  public Object getFieldValue(_Fields field) {
267
    switch (field) {
311
    switch (field) {
Line 272... Line 316...
272
      return getStateName();
316
      return getStateName();
273
 
317
 
274
    case VAT_TYPE:
318
    case VAT_TYPE:
275
      return getVatType();
319
      return getVatType();
276
 
320
 
-
 
321
    case STATE_CODE:
-
 
322
      return getStateCode();
-
 
323
 
277
    }
324
    }
278
    throw new IllegalStateException();
325
    throw new IllegalStateException();
279
  }
326
  }
280
 
327
 
281
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
328
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 289... Line 336...
289
      return isSetId();
336
      return isSetId();
290
    case STATE_NAME:
337
    case STATE_NAME:
291
      return isSetStateName();
338
      return isSetStateName();
292
    case VAT_TYPE:
339
    case VAT_TYPE:
293
      return isSetVatType();
340
      return isSetVatType();
-
 
341
    case STATE_CODE:
-
 
342
      return isSetStateCode();
294
    }
343
    }
295
    throw new IllegalStateException();
344
    throw new IllegalStateException();
296
  }
345
  }
297
 
346
 
298
  @Override
347
  @Override
Line 333... Line 382...
333
        return false;
382
        return false;
334
      if (!this.vatType.equals(that.vatType))
383
      if (!this.vatType.equals(that.vatType))
335
        return false;
384
        return false;
336
    }
385
    }
337
 
386
 
-
 
387
    boolean this_present_stateCode = true && this.isSetStateCode();
-
 
388
    boolean that_present_stateCode = true && that.isSetStateCode();
-
 
389
    if (this_present_stateCode || that_present_stateCode) {
-
 
390
      if (!(this_present_stateCode && that_present_stateCode))
-
 
391
        return false;
-
 
392
      if (!this.stateCode.equals(that.stateCode))
-
 
393
        return false;
-
 
394
    }
-
 
395
 
338
    return true;
396
    return true;
339
  }
397
  }
340
 
398
 
341
  @Override
399
  @Override
342
  public int hashCode() {
400
  public int hashCode() {
Line 379... Line 437...
379
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vatType, typedOther.vatType);
437
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vatType, typedOther.vatType);
380
      if (lastComparison != 0) {
438
      if (lastComparison != 0) {
381
        return lastComparison;
439
        return lastComparison;
382
      }
440
      }
383
    }
441
    }
-
 
442
    lastComparison = Boolean.valueOf(isSetStateCode()).compareTo(typedOther.isSetStateCode());
-
 
443
    if (lastComparison != 0) {
-
 
444
      return lastComparison;
-
 
445
    }
-
 
446
    if (isSetStateCode()) {
-
 
447
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stateCode, typedOther.stateCode);
-
 
448
      if (lastComparison != 0) {
-
 
449
        return lastComparison;
-
 
450
      }
-
 
451
    }
384
    return 0;
452
    return 0;
385
  }
453
  }
386
 
454
 
387
  public _Fields fieldForId(int fieldId) {
455
  public _Fields fieldForId(int fieldId) {
388
    return _Fields.findByThriftId(fieldId);
456
    return _Fields.findByThriftId(fieldId);
Line 418... Line 486...
418
            this.vatType = VatType.findByValue(iprot.readI32());
486
            this.vatType = VatType.findByValue(iprot.readI32());
419
          } else { 
487
          } else { 
420
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
488
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
421
          }
489
          }
422
          break;
490
          break;
-
 
491
        case 4: // STATE_CODE
-
 
492
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-
 
493
            this.stateCode = iprot.readString();
-
 
494
          } else { 
-
 
495
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
496
          }
-
 
497
          break;
423
        default:
498
        default:
424
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
499
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
425
      }
500
      }
426
      iprot.readFieldEnd();
501
      iprot.readFieldEnd();
427
    }
502
    }
Line 444... Line 519...
444
    if (this.vatType != null) {
519
    if (this.vatType != null) {
445
      oprot.writeFieldBegin(VAT_TYPE_FIELD_DESC);
520
      oprot.writeFieldBegin(VAT_TYPE_FIELD_DESC);
446
      oprot.writeI32(this.vatType.getValue());
521
      oprot.writeI32(this.vatType.getValue());
447
      oprot.writeFieldEnd();
522
      oprot.writeFieldEnd();
448
    }
523
    }
-
 
524
    if (this.stateCode != null) {
-
 
525
      oprot.writeFieldBegin(STATE_CODE_FIELD_DESC);
-
 
526
      oprot.writeString(this.stateCode);
-
 
527
      oprot.writeFieldEnd();
-
 
528
    }
449
    oprot.writeFieldStop();
529
    oprot.writeFieldStop();
450
    oprot.writeStructEnd();
530
    oprot.writeStructEnd();
451
  }
531
  }
452
 
532
 
453
  @Override
533
  @Override
Line 472... Line 552...
472
      sb.append("null");
552
      sb.append("null");
473
    } else {
553
    } else {
474
      sb.append(this.vatType);
554
      sb.append(this.vatType);
475
    }
555
    }
476
    first = false;
556
    first = false;
-
 
557
    if (!first) sb.append(", ");
-
 
558
    sb.append("stateCode:");
-
 
559
    if (this.stateCode == null) {
-
 
560
      sb.append("null");
-
 
561
    } else {
-
 
562
      sb.append(this.stateCode);
-
 
563
    }
-
 
564
    first = false;
477
    sb.append(")");
565
    sb.append(")");
478
    return sb.toString();
566
    return sb.toString();
479
  }
567
  }
480
 
568
 
481
  public void validate() throws org.apache.thrift.TException {
569
  public void validate() throws org.apache.thrift.TException {