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.model.v1.user;
6
package in.shop2020.model.v1.user;
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.*;
-
 
24
import org.apache.thrift.protocol.*;
-
 
25
 
-
 
26
/**
23
/**
27
 * Exceptions
24
 * Exceptions
28
 */
25
 */
29
public class AuthenticationException extends Exception implements TBase<AuthenticationException._Fields>, java.io.Serializable, Cloneable, Comparable<AuthenticationException> {
26
public class AuthenticationException extends Exception implements org.apache.thrift.TBase<AuthenticationException, AuthenticationException._Fields>, java.io.Serializable, Cloneable {
30
  private static final TStruct STRUCT_DESC = new TStruct("AuthenticationException");
27
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthenticationException");
31
 
28
 
32
  private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)1);
29
  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
33
  private static final TField ERROR_CODE_FIELD_DESC = new TField("errorCode", TType.I32, (short)2);
30
  private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)2);
34
 
31
 
35
  private String message;
32
  private String message; // required
36
  private int errorCode;
33
  private int errorCode; // required
37
 
34
 
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
35
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
39
  public enum _Fields implements TFieldIdEnum {
36
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40
    MESSAGE((short)1, "message"),
37
    MESSAGE((short)1, "message"),
41
    ERROR_CODE((short)2, "errorCode");
38
    ERROR_CODE((short)2, "errorCode");
42
 
39
 
43
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
45
 
41
 
46
    static {
42
    static {
47
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
48
        byId.put((int)field._thriftId, field);
-
 
49
        byName.put(field.getFieldName(), field);
44
        byName.put(field.getFieldName(), field);
50
      }
45
      }
51
    }
46
    }
52
 
47
 
53
    /**
48
    /**
54
     * Find the _Fields constant that matches fieldId, or null if its not found.
49
     * Find the _Fields constant that matches fieldId, or null if its not found.
55
     */
50
     */
56
    public static _Fields findByThriftId(int fieldId) {
51
    public static _Fields findByThriftId(int fieldId) {
57
      return byId.get(fieldId);
52
      switch(fieldId) {
-
 
53
        case 1: // MESSAGE
-
 
54
          return MESSAGE;
-
 
55
        case 2: // ERROR_CODE
-
 
56
          return ERROR_CODE;
-
 
57
        default:
-
 
58
          return null;
-
 
59
      }
58
    }
60
    }
59
 
61
 
60
    /**
62
    /**
61
     * Find the _Fields constant that matches fieldId, throwing an exception
63
     * Find the _Fields constant that matches fieldId, throwing an exception
62
     * if it is not found.
64
     * if it is not found.
Line 93... Line 95...
93
 
95
 
94
  // isset id assignments
96
  // isset id assignments
95
  private static final int __ERRORCODE_ISSET_ID = 0;
97
  private static final int __ERRORCODE_ISSET_ID = 0;
96
  private BitSet __isset_bit_vector = new BitSet(1);
98
  private BitSet __isset_bit_vector = new BitSet(1);
97
 
99
 
98
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
100
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
99
    put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, 
-
 
100
        new FieldValueMetaData(TType.STRING)));
-
 
101
    put(_Fields.ERROR_CODE, new FieldMetaData("errorCode", TFieldRequirementType.DEFAULT, 
-
 
102
        new FieldValueMetaData(TType.I32)));
-
 
103
  }});
-
 
104
 
-
 
105
  static {
101
  static {
-
 
102
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
103
    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
104
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
105
    tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
106
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
-
 
107
    metaDataMap = Collections.unmodifiableMap(tmpMap);
106
    FieldMetaData.addStructMetaDataMap(AuthenticationException.class, metaDataMap);
108
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AuthenticationException.class, metaDataMap);
107
  }
109
  }
108
 
110
 
109
  public AuthenticationException() {
111
  public AuthenticationException() {
110
  }
112
  }
111
 
113
 
Line 133... Line 135...
133
 
135
 
134
  public AuthenticationException deepCopy() {
136
  public AuthenticationException deepCopy() {
135
    return new AuthenticationException(this);
137
    return new AuthenticationException(this);
136
  }
138
  }
137
 
139
 
138
  @Deprecated
140
  @Override
139
  public AuthenticationException clone() {
141
  public void clear() {
-
 
142
    this.message = null;
140
    return new AuthenticationException(this);
143
    setErrorCodeIsSet(false);
-
 
144
    this.errorCode = 0;
141
  }
145
  }
142
 
146
 
143
  public String getMessage() {
147
  public String getMessage() {
144
    return this.message;
148
    return this.message;
145
  }
149
  }
146
 
150
 
147
  public AuthenticationException setMessage(String message) {
151
  public void setMessage(String message) {
148
    this.message = message;
152
    this.message = message;
149
    return this;
-
 
150
  }
153
  }
151
 
154
 
152
  public void unsetMessage() {
155
  public void unsetMessage() {
153
    this.message = null;
156
    this.message = null;
154
  }
157
  }
155
 
158
 
156
  /** Returns true if field message is set (has been asigned a value) and false otherwise */
159
  /** Returns true if field message is set (has been assigned a value) and false otherwise */
157
  public boolean isSetMessage() {
160
  public boolean isSetMessage() {
158
    return this.message != null;
161
    return this.message != null;
159
  }
162
  }
160
 
163
 
161
  public void setMessageIsSet(boolean value) {
164
  public void setMessageIsSet(boolean value) {
Line 166... Line 169...
166
 
169
 
167
  public int getErrorCode() {
170
  public int getErrorCode() {
168
    return this.errorCode;
171
    return this.errorCode;
169
  }
172
  }
170
 
173
 
171
  public AuthenticationException setErrorCode(int errorCode) {
174
  public void setErrorCode(int errorCode) {
172
    this.errorCode = errorCode;
175
    this.errorCode = errorCode;
173
    setErrorCodeIsSet(true);
176
    setErrorCodeIsSet(true);
174
    return this;
-
 
175
  }
177
  }
176
 
178
 
177
  public void unsetErrorCode() {
179
  public void unsetErrorCode() {
178
    __isset_bit_vector.clear(__ERRORCODE_ISSET_ID);
180
    __isset_bit_vector.clear(__ERRORCODE_ISSET_ID);
179
  }
181
  }
180
 
182
 
181
  /** Returns true if field errorCode is set (has been asigned a value) and false otherwise */
183
  /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */
182
  public boolean isSetErrorCode() {
184
  public boolean isSetErrorCode() {
183
    return __isset_bit_vector.get(__ERRORCODE_ISSET_ID);
185
    return __isset_bit_vector.get(__ERRORCODE_ISSET_ID);
184
  }
186
  }
185
 
187
 
186
  public void setErrorCodeIsSet(boolean value) {
188
  public void setErrorCodeIsSet(boolean value) {
Line 206... Line 208...
206
      break;
208
      break;
207
 
209
 
208
    }
210
    }
209
  }
211
  }
210
 
212
 
211
  public void setFieldValue(int fieldID, Object value) {
-
 
212
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
213
  }
-
 
214
 
-
 
215
  public Object getFieldValue(_Fields field) {
213
  public Object getFieldValue(_Fields field) {
216
    switch (field) {
214
    switch (field) {
217
    case MESSAGE:
215
    case MESSAGE:
218
      return getMessage();
216
      return getMessage();
219
 
217
 
220
    case ERROR_CODE:
218
    case ERROR_CODE:
221
      return new Integer(getErrorCode());
219
      return Integer.valueOf(getErrorCode());
222
 
220
 
223
    }
221
    }
224
    throw new IllegalStateException();
222
    throw new IllegalStateException();
225
  }
223
  }
226
 
224
 
227
  public Object getFieldValue(int fieldId) {
-
 
228
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
229
  }
-
 
230
 
-
 
231
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
225
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
232
  public boolean isSet(_Fields field) {
226
  public boolean isSet(_Fields field) {
-
 
227
    if (field == null) {
-
 
228
      throw new IllegalArgumentException();
-
 
229
    }
-
 
230
 
233
    switch (field) {
231
    switch (field) {
234
    case MESSAGE:
232
    case MESSAGE:
235
      return isSetMessage();
233
      return isSetMessage();
236
    case ERROR_CODE:
234
    case ERROR_CODE:
237
      return isSetErrorCode();
235
      return isSetErrorCode();
238
    }
236
    }
239
    throw new IllegalStateException();
237
    throw new IllegalStateException();
240
  }
238
  }
241
 
239
 
242
  public boolean isSet(int fieldID) {
-
 
243
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
244
  }
-
 
245
 
-
 
246
  @Override
240
  @Override
247
  public boolean equals(Object that) {
241
  public boolean equals(Object that) {
248
    if (that == null)
242
    if (that == null)
249
      return false;
243
      return false;
250
    if (that instanceof AuthenticationException)
244
    if (that instanceof AuthenticationException)
Line 288... Line 282...
288
    }
282
    }
289
 
283
 
290
    int lastComparison = 0;
284
    int lastComparison = 0;
291
    AuthenticationException typedOther = (AuthenticationException)other;
285
    AuthenticationException typedOther = (AuthenticationException)other;
292
 
286
 
293
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
287
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
294
    if (lastComparison != 0) {
288
    if (lastComparison != 0) {
295
      return lastComparison;
289
      return lastComparison;
296
    }
290
    }
-
 
291
    if (isSetMessage()) {
297
    lastComparison = TBaseHelper.compareTo(message, typedOther.message);
292
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
298
    if (lastComparison != 0) {
293
      if (lastComparison != 0) {
299
      return lastComparison;
294
        return lastComparison;
-
 
295
      }
300
    }
296
    }
301
    lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(isSetErrorCode());
297
    lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(typedOther.isSetErrorCode());
302
    if (lastComparison != 0) {
298
    if (lastComparison != 0) {
303
      return lastComparison;
299
      return lastComparison;
304
    }
300
    }
-
 
301
    if (isSetErrorCode()) {
305
    lastComparison = TBaseHelper.compareTo(errorCode, typedOther.errorCode);
302
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, typedOther.errorCode);
306
    if (lastComparison != 0) {
303
      if (lastComparison != 0) {
307
      return lastComparison;
304
        return lastComparison;
-
 
305
      }
308
    }
306
    }
309
    return 0;
307
    return 0;
310
  }
308
  }
311
 
309
 
-
 
310
  public _Fields fieldForId(int fieldId) {
-
 
311
    return _Fields.findByThriftId(fieldId);
-
 
312
  }
-
 
313
 
312
  public void read(TProtocol iprot) throws TException {
314
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
313
    TField field;
315
    org.apache.thrift.protocol.TField field;
314
    iprot.readStructBegin();
316
    iprot.readStructBegin();
315
    while (true)
317
    while (true)
316
    {
318
    {
317
      field = iprot.readFieldBegin();
319
      field = iprot.readFieldBegin();
318
      if (field.type == TType.STOP) { 
320
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
319
        break;
321
        break;
320
      }
322
      }
321
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
322
      if (fieldId == null) {
-
 
323
        TProtocolUtil.skip(iprot, field.type);
-
 
324
      } else {
-
 
325
        switch (fieldId) {
323
      switch (field.id) {
326
          case MESSAGE:
324
        case 1: // MESSAGE
327
            if (field.type == TType.STRING) {
325
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
328
              this.message = iprot.readString();
326
            this.message = iprot.readString();
329
            } else { 
327
          } else { 
330
              TProtocolUtil.skip(iprot, field.type);
328
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
331
            }
329
          }
332
            break;
330
          break;
333
          case ERROR_CODE:
331
        case 2: // ERROR_CODE
334
            if (field.type == TType.I32) {
332
          if (field.type == org.apache.thrift.protocol.TType.I32) {
335
              this.errorCode = iprot.readI32();
333
            this.errorCode = iprot.readI32();
336
              setErrorCodeIsSet(true);
334
            setErrorCodeIsSet(true);
337
            } else { 
335
          } else { 
338
              TProtocolUtil.skip(iprot, field.type);
336
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
339
            }
337
          }
340
            break;
338
          break;
341
        }
339
        default:
342
        iprot.readFieldEnd();
340
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
343
      }
341
      }
-
 
342
      iprot.readFieldEnd();
344
    }
343
    }
345
    iprot.readStructEnd();
344
    iprot.readStructEnd();
346
    validate();
345
    validate();
347
  }
346
  }
348
 
347
 
349
  public void write(TProtocol oprot) throws TException {
348
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
350
    validate();
349
    validate();
351
 
350
 
352
    oprot.writeStructBegin(STRUCT_DESC);
351
    oprot.writeStructBegin(STRUCT_DESC);
353
    if (this.message != null) {
352
    if (this.message != null) {
354
      oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
353
      oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
Line 380... Line 379...
380
    first = false;
379
    first = false;
381
    sb.append(")");
380
    sb.append(")");
382
    return sb.toString();
381
    return sb.toString();
383
  }
382
  }
384
 
383
 
385
  public void validate() throws TException {
384
  public void validate() throws org.apache.thrift.TException {
386
    // check for required fields
385
    // check for required fields
387
  }
386
  }
388
 
387
 
-
 
388
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
389
    try {
-
 
390
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
391
    } catch (org.apache.thrift.TException te) {
-
 
392
      throw new java.io.IOException(te);
-
 
393
    }
-
 
394
  }
-
 
395
 
-
 
396
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
397
    try {
-
 
398
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
399
      __isset_bit_vector = new BitSet(1);
-
 
400
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
401
    } catch (org.apache.thrift.TException te) {
-
 
402
      throw new java.io.IOException(te);
-
 
403
    }
-
 
404
  }
-
 
405
 
389
}
406
}
390
 
407