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.utils;
6
package in.shop2020.utils;
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 LogisticsUser implements org.apache.thrift.TBase<LogisticsUser, LogisticsUser._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("LogisticsUser");
25
 
25
 
26
public class LogisticsUser implements TBase<LogisticsUser._Fields>, java.io.Serializable, Cloneable, Comparable<LogisticsUser> {
26
  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
27
  private static final TStruct STRUCT_DESC = new TStruct("LogisticsUser");
27
  private static final org.apache.thrift.protocol.TField PROVIDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("providerId", org.apache.thrift.protocol.TType.I64, (short)2);
28
 
28
 
29
  private static final TField USERNAME_FIELD_DESC = new TField("username", TType.STRING, (short)1);
-
 
30
  private static final TField PROVIDER_ID_FIELD_DESC = new TField("providerId", TType.I64, (short)2);
-
 
31
 
-
 
32
  private String username;
29
  private String username; // required
33
  private long providerId;
30
  private long providerId; // 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
    USERNAME((short)1, "username"),
34
    USERNAME((short)1, "username"),
38
    PROVIDER_ID((short)2, "providerId");
35
    PROVIDER_ID((short)2, "providerId");
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: // USERNAME
-
 
51
          return USERNAME;
-
 
52
        case 2: // PROVIDER_ID
-
 
53
          return PROVIDER_ID;
-
 
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 __PROVIDERID_ISSET_ID = 0;
94
  private static final int __PROVIDERID_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.USERNAME, new FieldMetaData("username", TFieldRequirementType.DEFAULT, 
-
 
97
        new FieldValueMetaData(TType.STRING)));
-
 
98
    put(_Fields.PROVIDER_ID, new FieldMetaData("providerId", TFieldRequirementType.DEFAULT, 
-
 
99
        new FieldValueMetaData(TType.I64)));
-
 
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.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
101
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
102
    tmpMap.put(_Fields.PROVIDER_ID, new org.apache.thrift.meta_data.FieldMetaData("providerId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
103
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
104
    metaDataMap = Collections.unmodifiableMap(tmpMap);
103
    FieldMetaData.addStructMetaDataMap(LogisticsUser.class, metaDataMap);
105
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LogisticsUser.class, metaDataMap);
104
  }
106
  }
105
 
107
 
106
  public LogisticsUser() {
108
  public LogisticsUser() {
107
  }
109
  }
108
 
110
 
Line 130... Line 132...
130
 
132
 
131
  public LogisticsUser deepCopy() {
133
  public LogisticsUser deepCopy() {
132
    return new LogisticsUser(this);
134
    return new LogisticsUser(this);
133
  }
135
  }
134
 
136
 
135
  @Deprecated
137
  @Override
136
  public LogisticsUser clone() {
138
  public void clear() {
-
 
139
    this.username = null;
137
    return new LogisticsUser(this);
140
    setProviderIdIsSet(false);
-
 
141
    this.providerId = 0;
138
  }
142
  }
139
 
143
 
140
  public String getUsername() {
144
  public String getUsername() {
141
    return this.username;
145
    return this.username;
142
  }
146
  }
143
 
147
 
144
  public LogisticsUser setUsername(String username) {
148
  public void setUsername(String username) {
145
    this.username = username;
149
    this.username = username;
146
    return this;
-
 
147
  }
150
  }
148
 
151
 
149
  public void unsetUsername() {
152
  public void unsetUsername() {
150
    this.username = null;
153
    this.username = null;
151
  }
154
  }
152
 
155
 
153
  /** Returns true if field username is set (has been asigned a value) and false otherwise */
156
  /** Returns true if field username is set (has been assigned a value) and false otherwise */
154
  public boolean isSetUsername() {
157
  public boolean isSetUsername() {
155
    return this.username != null;
158
    return this.username != null;
156
  }
159
  }
157
 
160
 
158
  public void setUsernameIsSet(boolean value) {
161
  public void setUsernameIsSet(boolean value) {
Line 163... Line 166...
163
 
166
 
164
  public long getProviderId() {
167
  public long getProviderId() {
165
    return this.providerId;
168
    return this.providerId;
166
  }
169
  }
167
 
170
 
168
  public LogisticsUser setProviderId(long providerId) {
171
  public void setProviderId(long providerId) {
169
    this.providerId = providerId;
172
    this.providerId = providerId;
170
    setProviderIdIsSet(true);
173
    setProviderIdIsSet(true);
171
    return this;
-
 
172
  }
174
  }
173
 
175
 
174
  public void unsetProviderId() {
176
  public void unsetProviderId() {
175
    __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
177
    __isset_bit_vector.clear(__PROVIDERID_ISSET_ID);
176
  }
178
  }
177
 
179
 
178
  /** Returns true if field providerId is set (has been asigned a value) and false otherwise */
180
  /** Returns true if field providerId is set (has been assigned a value) and false otherwise */
179
  public boolean isSetProviderId() {
181
  public boolean isSetProviderId() {
180
    return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
182
    return __isset_bit_vector.get(__PROVIDERID_ISSET_ID);
181
  }
183
  }
182
 
184
 
183
  public void setProviderIdIsSet(boolean value) {
185
  public void setProviderIdIsSet(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 USERNAME:
212
    case USERNAME:
215
      return getUsername();
213
      return getUsername();
216
 
214
 
217
    case PROVIDER_ID:
215
    case PROVIDER_ID:
218
      return new Long(getProviderId());
216
      return Long.valueOf(getProviderId());
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 USERNAME:
229
    case USERNAME:
232
      return isSetUsername();
230
      return isSetUsername();
233
    case PROVIDER_ID:
231
    case PROVIDER_ID:
234
      return isSetProviderId();
232
      return isSetProviderId();
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 LogisticsUser)
241
    if (that instanceof LogisticsUser)
Line 285... Line 279...
285
    }
279
    }
286
 
280
 
287
    int lastComparison = 0;
281
    int lastComparison = 0;
288
    LogisticsUser typedOther = (LogisticsUser)other;
282
    LogisticsUser typedOther = (LogisticsUser)other;
289
 
283
 
290
    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(isSetUsername());
284
    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
291
    if (lastComparison != 0) {
285
    if (lastComparison != 0) {
292
      return lastComparison;
286
      return lastComparison;
293
    }
287
    }
-
 
288
    if (isSetUsername()) {
294
    lastComparison = TBaseHelper.compareTo(username, typedOther.username);
289
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username);
295
    if (lastComparison != 0) {
290
      if (lastComparison != 0) {
296
      return lastComparison;
291
        return lastComparison;
-
 
292
      }
297
    }
293
    }
298
    lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(isSetProviderId());
294
    lastComparison = Boolean.valueOf(isSetProviderId()).compareTo(typedOther.isSetProviderId());
299
    if (lastComparison != 0) {
295
    if (lastComparison != 0) {
300
      return lastComparison;
296
      return lastComparison;
301
    }
297
    }
-
 
298
    if (isSetProviderId()) {
302
    lastComparison = TBaseHelper.compareTo(providerId, typedOther.providerId);
299
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.providerId, typedOther.providerId);
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 USERNAME:
321
        case 1: // USERNAME
324
            if (field.type == TType.STRING) {
322
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
325
              this.username = iprot.readString();
323
            this.username = iprot.readString();
326
            } else { 
324
          } else { 
327
              TProtocolUtil.skip(iprot, field.type);
325
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
328
            }
326
          }
329
            break;
327
          break;
330
          case PROVIDER_ID:
328
        case 2: // PROVIDER_ID
331
            if (field.type == TType.I64) {
329
          if (field.type == org.apache.thrift.protocol.TType.I64) {
332
              this.providerId = iprot.readI64();
330
            this.providerId = iprot.readI64();
333
              setProviderIdIsSet(true);
331
            setProviderIdIsSet(true);
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
    if (this.username != null) {
349
    if (this.username != null) {
351
      oprot.writeFieldBegin(USERNAME_FIELD_DESC);
350
      oprot.writeFieldBegin(USERNAME_FIELD_DESC);
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