Subversion Repositories SmartDukaan

Rev

Rev 1013 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1013 Rev 3430
Line 1... Line 1...
1
/**
1
/**
2
 * Autogenerated by Thrift
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
5
 */
6
package in.shop2020.test;
6
package in.shop2020.test;
7
 
7
 
Line 13... Line 13...
13
import java.util.Set;
13
import java.util.Set;
14
import java.util.HashSet;
14
import java.util.HashSet;
15
import java.util.EnumSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
16
import java.util.Collections;
17
import java.util.BitSet;
17
import java.util.BitSet;
-
 
18
import java.nio.ByteBuffer;
18
import java.util.Arrays;
19
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
import org.slf4j.LoggerFactory;
21
 
22
 
22
import org.apache.thrift.*;
-
 
23
import org.apache.thrift.meta_data.*;
23
public class Address implements org.apache.thrift.TBase<Address, Address._Fields>, java.io.Serializable, Cloneable {
24
import org.apache.thrift.protocol.*;
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Address");
25
 
25
 
26
public class Address implements TBase<Address._Fields>, java.io.Serializable, Cloneable, Comparable<Address> {
26
  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)1);
27
  private static final TStruct STRUCT_DESC = new TStruct("Address");
27
  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)2);
28
 
28
 
29
  private static final TField ADDRESS_ID_FIELD_DESC = new TField("addressId", TType.I64, (short)1);
-
 
30
  private static final TField ADDRESS_FIELD_DESC = new TField("address", TType.STRING, (short)2);
-
 
31
 
-
 
32
  private long addressId;
29
  private long addressId; // required
33
  private String address;
30
  private String address; // required
34
 
31
 
35
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
32
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  public enum _Fields implements TFieldIdEnum {
33
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
37
    ADDRESS_ID((short)1, "addressId"),
34
    ADDRESS_ID((short)1, "addressId"),
38
    ADDRESS((short)2, "address");
35
    ADDRESS((short)2, "address");
39
 
36
 
40
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
41
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
37
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
42
 
38
 
43
    static {
39
    static {
44
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
40
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
45
        byId.put((int)field._thriftId, field);
-
 
46
        byName.put(field.getFieldName(), field);
41
        byName.put(field.getFieldName(), field);
47
      }
42
      }
48
    }
43
    }
49
 
44
 
50
    /**
45
    /**
51
     * Find the _Fields constant that matches fieldId, or null if its not found.
46
     * Find the _Fields constant that matches fieldId, or null if its not found.
52
     */
47
     */
53
    public static _Fields findByThriftId(int fieldId) {
48
    public static _Fields findByThriftId(int fieldId) {
54
      return byId.get(fieldId);
49
      switch(fieldId) {
-
 
50
        case 1: // ADDRESS_ID
-
 
51
          return ADDRESS_ID;
-
 
52
        case 2: // ADDRESS
-
 
53
          return ADDRESS;
-
 
54
        default:
-
 
55
          return null;
-
 
56
      }
55
    }
57
    }
56
 
58
 
57
    /**
59
    /**
58
     * Find the _Fields constant that matches fieldId, throwing an exception
60
     * Find the _Fields constant that matches fieldId, throwing an exception
59
     * if it is not found.
61
     * if it is not found.
Line 90... Line 92...
90
 
92
 
91
  // isset id assignments
93
  // isset id assignments
92
  private static final int __ADDRESSID_ISSET_ID = 0;
94
  private static final int __ADDRESSID_ISSET_ID = 0;
93
  private BitSet __isset_bit_vector = new BitSet(1);
95
  private BitSet __isset_bit_vector = new BitSet(1);
94
 
96
 
95
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
97
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
96
    put(_Fields.ADDRESS_ID, new FieldMetaData("addressId", TFieldRequirementType.DEFAULT, 
-
 
97
        new FieldValueMetaData(TType.I64)));
-
 
98
    put(_Fields.ADDRESS, new FieldMetaData("address", TFieldRequirementType.DEFAULT, 
-
 
99
        new FieldValueMetaData(TType.STRING)));
-
 
100
  }});
-
 
101
 
-
 
102
  static {
98
  static {
-
 
99
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
100
    tmpMap.put(_Fields.ADDRESS_ID, new org.apache.thrift.meta_data.FieldMetaData("addressId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
101
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
102
    tmpMap.put(_Fields.ADDRESS, new org.apache.thrift.meta_data.FieldMetaData("address", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
103
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
104
    metaDataMap = Collections.unmodifiableMap(tmpMap);
103
    FieldMetaData.addStructMetaDataMap(Address.class, metaDataMap);
105
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Address.class, metaDataMap);
104
  }
106
  }
105
 
107
 
106
  public Address() {
108
  public Address() {
107
  }
109
  }
108
 
110
 
Line 130... Line 132...
130
 
132
 
131
  public Address deepCopy() {
133
  public Address deepCopy() {
132
    return new Address(this);
134
    return new Address(this);
133
  }
135
  }
134
 
136
 
135
  @Deprecated
137
  @Override
136
  public Address clone() {
138
  public void clear() {
137
    return new Address(this);
139
    setAddressIdIsSet(false);
-
 
140
    this.addressId = 0;
-
 
141
    this.address = null;
138
  }
142
  }
139
 
143
 
140
  public long getAddressId() {
144
  public long getAddressId() {
141
    return this.addressId;
145
    return this.addressId;
142
  }
146
  }
143
 
147
 
144
  public Address setAddressId(long addressId) {
148
  public void setAddressId(long addressId) {
145
    this.addressId = addressId;
149
    this.addressId = addressId;
146
    setAddressIdIsSet(true);
150
    setAddressIdIsSet(true);
147
    return this;
-
 
148
  }
151
  }
149
 
152
 
150
  public void unsetAddressId() {
153
  public void unsetAddressId() {
151
    __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
154
    __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
152
  }
155
  }
153
 
156
 
154
  /** Returns true if field addressId is set (has been asigned a value) and false otherwise */
157
  /** Returns true if field addressId is set (has been assigned a value) and false otherwise */
155
  public boolean isSetAddressId() {
158
  public boolean isSetAddressId() {
156
    return __isset_bit_vector.get(__ADDRESSID_ISSET_ID);
159
    return __isset_bit_vector.get(__ADDRESSID_ISSET_ID);
157
  }
160
  }
158
 
161
 
159
  public void setAddressIdIsSet(boolean value) {
162
  public void setAddressIdIsSet(boolean value) {
Line 162... Line 165...
162
 
165
 
163
  public String getAddress() {
166
  public String getAddress() {
164
    return this.address;
167
    return this.address;
165
  }
168
  }
166
 
169
 
167
  public Address setAddress(String address) {
170
  public void setAddress(String address) {
168
    this.address = address;
171
    this.address = address;
169
    return this;
-
 
170
  }
172
  }
171
 
173
 
172
  public void unsetAddress() {
174
  public void unsetAddress() {
173
    this.address = null;
175
    this.address = null;
174
  }
176
  }
175
 
177
 
176
  /** Returns true if field address is set (has been asigned a value) and false otherwise */
178
  /** Returns true if field address is set (has been assigned a value) and false otherwise */
177
  public boolean isSetAddress() {
179
  public boolean isSetAddress() {
178
    return this.address != null;
180
    return this.address != null;
179
  }
181
  }
180
 
182
 
181
  public void setAddressIsSet(boolean value) {
183
  public void setAddressIsSet(boolean value) {
Line 203... Line 205...
203
      break;
205
      break;
204
 
206
 
205
    }
207
    }
206
  }
208
  }
207
 
209
 
208
  public void setFieldValue(int fieldID, Object value) {
-
 
209
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
210
  }
-
 
211
 
-
 
212
  public Object getFieldValue(_Fields field) {
210
  public Object getFieldValue(_Fields field) {
213
    switch (field) {
211
    switch (field) {
214
    case ADDRESS_ID:
212
    case ADDRESS_ID:
215
      return new Long(getAddressId());
213
      return Long.valueOf(getAddressId());
216
 
214
 
217
    case ADDRESS:
215
    case ADDRESS:
218
      return getAddress();
216
      return getAddress();
219
 
217
 
220
    }
218
    }
221
    throw new IllegalStateException();
219
    throw new IllegalStateException();
222
  }
220
  }
223
 
221
 
224
  public Object getFieldValue(int fieldId) {
-
 
225
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
226
  }
-
 
227
 
-
 
228
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
222
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
229
  public boolean isSet(_Fields field) {
223
  public boolean isSet(_Fields field) {
-
 
224
    if (field == null) {
-
 
225
      throw new IllegalArgumentException();
-
 
226
    }
-
 
227
 
230
    switch (field) {
228
    switch (field) {
231
    case ADDRESS_ID:
229
    case ADDRESS_ID:
232
      return isSetAddressId();
230
      return isSetAddressId();
233
    case ADDRESS:
231
    case ADDRESS:
234
      return isSetAddress();
232
      return isSetAddress();
235
    }
233
    }
236
    throw new IllegalStateException();
234
    throw new IllegalStateException();
237
  }
235
  }
238
 
236
 
239
  public boolean isSet(int fieldID) {
-
 
240
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
241
  }
-
 
242
 
-
 
243
  @Override
237
  @Override
244
  public boolean equals(Object that) {
238
  public boolean equals(Object that) {
245
    if (that == null)
239
    if (that == null)
246
      return false;
240
      return false;
247
    if (that instanceof Address)
241
    if (that instanceof Address)
Line 285... Line 279...
285
    }
279
    }
286
 
280
 
287
    int lastComparison = 0;
281
    int lastComparison = 0;
288
    Address typedOther = (Address)other;
282
    Address typedOther = (Address)other;
289
 
283
 
290
    lastComparison = Boolean.valueOf(isSetAddressId()).compareTo(isSetAddressId());
284
    lastComparison = Boolean.valueOf(isSetAddressId()).compareTo(typedOther.isSetAddressId());
291
    if (lastComparison != 0) {
285
    if (lastComparison != 0) {
292
      return lastComparison;
286
      return lastComparison;
293
    }
287
    }
-
 
288
    if (isSetAddressId()) {
294
    lastComparison = TBaseHelper.compareTo(addressId, typedOther.addressId);
289
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addressId, typedOther.addressId);
295
    if (lastComparison != 0) {
290
      if (lastComparison != 0) {
296
      return lastComparison;
291
        return lastComparison;
-
 
292
      }
297
    }
293
    }
298
    lastComparison = Boolean.valueOf(isSetAddress()).compareTo(isSetAddress());
294
    lastComparison = Boolean.valueOf(isSetAddress()).compareTo(typedOther.isSetAddress());
299
    if (lastComparison != 0) {
295
    if (lastComparison != 0) {
300
      return lastComparison;
296
      return lastComparison;
301
    }
297
    }
-
 
298
    if (isSetAddress()) {
302
    lastComparison = TBaseHelper.compareTo(address, typedOther.address);
299
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.address, typedOther.address);
303
    if (lastComparison != 0) {
300
      if (lastComparison != 0) {
304
      return lastComparison;
301
        return lastComparison;
-
 
302
      }
305
    }
303
    }
306
    return 0;
304
    return 0;
307
  }
305
  }
308
 
306
 
-
 
307
  public _Fields fieldForId(int fieldId) {
-
 
308
    return _Fields.findByThriftId(fieldId);
-
 
309
  }
-
 
310
 
309
  public void read(TProtocol iprot) throws TException {
311
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
310
    TField field;
312
    org.apache.thrift.protocol.TField field;
311
    iprot.readStructBegin();
313
    iprot.readStructBegin();
312
    while (true)
314
    while (true)
313
    {
315
    {
314
      field = iprot.readFieldBegin();
316
      field = iprot.readFieldBegin();
315
      if (field.type == TType.STOP) { 
317
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
316
        break;
318
        break;
317
      }
319
      }
318
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
319
      if (fieldId == null) {
-
 
320
        TProtocolUtil.skip(iprot, field.type);
-
 
321
      } else {
-
 
322
        switch (fieldId) {
320
      switch (field.id) {
323
          case ADDRESS_ID:
321
        case 1: // ADDRESS_ID
324
            if (field.type == TType.I64) {
322
          if (field.type == org.apache.thrift.protocol.TType.I64) {
325
              this.addressId = iprot.readI64();
323
            this.addressId = iprot.readI64();
326
              setAddressIdIsSet(true);
324
            setAddressIdIsSet(true);
327
            } else { 
325
          } else { 
328
              TProtocolUtil.skip(iprot, field.type);
326
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
329
            }
327
          }
330
            break;
328
          break;
331
          case ADDRESS:
329
        case 2: // ADDRESS
332
            if (field.type == TType.STRING) {
330
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
333
              this.address = iprot.readString();
331
            this.address = iprot.readString();
334
            } else { 
332
          } else { 
335
              TProtocolUtil.skip(iprot, field.type);
333
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
336
            }
334
          }
337
            break;
335
          break;
338
        }
336
        default:
339
        iprot.readFieldEnd();
337
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
340
      }
338
      }
-
 
339
      iprot.readFieldEnd();
341
    }
340
    }
342
    iprot.readStructEnd();
341
    iprot.readStructEnd();
343
    validate();
342
    validate();
344
  }
343
  }
345
 
344
 
346
  public void write(TProtocol oprot) throws TException {
345
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
347
    validate();
346
    validate();
348
 
347
 
349
    oprot.writeStructBegin(STRUCT_DESC);
348
    oprot.writeStructBegin(STRUCT_DESC);
350
    oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
349
    oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
351
    oprot.writeI64(this.addressId);
350
    oprot.writeI64(this.addressId);
Line 377... Line 376...
377
    first = false;
376
    first = false;
378
    sb.append(")");
377
    sb.append(")");
379
    return sb.toString();
378
    return sb.toString();
380
  }
379
  }
381
 
380
 
382
  public void validate() throws TException {
381
  public void validate() throws org.apache.thrift.TException {
383
    // check for required fields
382
    // check for required fields
384
  }
383
  }
385
 
384
 
-
 
385
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
386
    try {
-
 
387
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
388
    } catch (org.apache.thrift.TException te) {
-
 
389
      throw new java.io.IOException(te);
-
 
390
    }
-
 
391
  }
-
 
392
 
-
 
393
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
394
    try {
-
 
395
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
396
      __isset_bit_vector = new BitSet(1);
-
 
397
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
398
    } catch (org.apache.thrift.TException te) {
-
 
399
      throw new java.io.IOException(te);
-
 
400
    }
-
 
401
  }
-
 
402
 
386
}
403
}
387
 
404