Subversion Repositories SmartDukaan

Rev

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

Rev 1998 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.*;
23
public class UserAffiliateException extends Exception implements org.apache.thrift.TBase<UserAffiliateException, UserAffiliateException._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("UserAffiliateException");
25
 
25
 
26
public class UserAffiliateException extends Exception implements TBase<UserAffiliateException._Fields>, java.io.Serializable, Cloneable, Comparable<UserAffiliateException> {
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 TStruct STRUCT_DESC = new TStruct("UserAffiliateException");
27
  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)2);
28
 
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
-
 
30
  private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)2);
-
 
31
 
-
 
32
  private long id;
29
  private long id; // required
33
  private String message;
30
  private String message; // 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
    ID((short)1, "id"),
34
    ID((short)1, "id"),
38
    MESSAGE((short)2, "message");
35
    MESSAGE((short)2, "message");
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: // ID
-
 
51
          return ID;
-
 
52
        case 2: // MESSAGE
-
 
53
          return MESSAGE;
-
 
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 __ID_ISSET_ID = 0;
94
  private static final int __ID_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.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
-
 
97
        new FieldValueMetaData(TType.I64)));
-
 
98
    put(_Fields.MESSAGE, new FieldMetaData("message", 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
101
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
102
    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(UserAffiliateException.class, metaDataMap);
105
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserAffiliateException.class, metaDataMap);
104
  }
106
  }
105
 
107
 
106
  public UserAffiliateException() {
108
  public UserAffiliateException() {
107
  }
109
  }
108
 
110
 
Line 130... Line 132...
130
 
132
 
131
  public UserAffiliateException deepCopy() {
133
  public UserAffiliateException deepCopy() {
132
    return new UserAffiliateException(this);
134
    return new UserAffiliateException(this);
133
  }
135
  }
134
 
136
 
135
  @Deprecated
137
  @Override
136
  public UserAffiliateException clone() {
138
  public void clear() {
137
    return new UserAffiliateException(this);
139
    setIdIsSet(false);
-
 
140
    this.id = 0;
-
 
141
    this.message = null;
138
  }
142
  }
139
 
143
 
140
  public long getId() {
144
  public long getId() {
141
    return this.id;
145
    return this.id;
142
  }
146
  }
143
 
147
 
144
  public UserAffiliateException setId(long id) {
148
  public void setId(long id) {
145
    this.id = id;
149
    this.id = id;
146
    setIdIsSet(true);
150
    setIdIsSet(true);
147
    return this;
-
 
148
  }
151
  }
149
 
152
 
150
  public void unsetId() {
153
  public void unsetId() {
151
    __isset_bit_vector.clear(__ID_ISSET_ID);
154
    __isset_bit_vector.clear(__ID_ISSET_ID);
152
  }
155
  }
153
 
156
 
154
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
157
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
155
  public boolean isSetId() {
158
  public boolean isSetId() {
156
    return __isset_bit_vector.get(__ID_ISSET_ID);
159
    return __isset_bit_vector.get(__ID_ISSET_ID);
157
  }
160
  }
158
 
161
 
159
  public void setIdIsSet(boolean value) {
162
  public void setIdIsSet(boolean value) {
Line 162... Line 165...
162
 
165
 
163
  public String getMessage() {
166
  public String getMessage() {
164
    return this.message;
167
    return this.message;
165
  }
168
  }
166
 
169
 
167
  public UserAffiliateException setMessage(String message) {
170
  public void setMessage(String message) {
168
    this.message = message;
171
    this.message = message;
169
    return this;
-
 
170
  }
172
  }
171
 
173
 
172
  public void unsetMessage() {
174
  public void unsetMessage() {
173
    this.message = null;
175
    this.message = null;
174
  }
176
  }
175
 
177
 
176
  /** Returns true if field message is set (has been asigned a value) and false otherwise */
178
  /** Returns true if field message is set (has been assigned a value) and false otherwise */
177
  public boolean isSetMessage() {
179
  public boolean isSetMessage() {
178
    return this.message != null;
180
    return this.message != null;
179
  }
181
  }
180
 
182
 
181
  public void setMessageIsSet(boolean value) {
183
  public void setMessageIsSet(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 ID:
212
    case ID:
215
      return new Long(getId());
213
      return Long.valueOf(getId());
216
 
214
 
217
    case MESSAGE:
215
    case MESSAGE:
218
      return getMessage();
216
      return getMessage();
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 ID:
229
    case ID:
232
      return isSetId();
230
      return isSetId();
233
    case MESSAGE:
231
    case MESSAGE:
234
      return isSetMessage();
232
      return isSetMessage();
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 UserAffiliateException)
241
    if (that instanceof UserAffiliateException)
Line 285... Line 279...
285
    }
279
    }
286
 
280
 
287
    int lastComparison = 0;
281
    int lastComparison = 0;
288
    UserAffiliateException typedOther = (UserAffiliateException)other;
282
    UserAffiliateException typedOther = (UserAffiliateException)other;
289
 
283
 
290
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
284
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
291
    if (lastComparison != 0) {
285
    if (lastComparison != 0) {
292
      return lastComparison;
286
      return lastComparison;
293
    }
287
    }
-
 
288
    if (isSetId()) {
294
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
289
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
295
    if (lastComparison != 0) {
290
      if (lastComparison != 0) {
296
      return lastComparison;
291
        return lastComparison;
-
 
292
      }
297
    }
293
    }
298
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
294
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
299
    if (lastComparison != 0) {
295
    if (lastComparison != 0) {
300
      return lastComparison;
296
      return lastComparison;
301
    }
297
    }
-
 
298
    if (isSetMessage()) {
302
    lastComparison = TBaseHelper.compareTo(message, typedOther.message);
299
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
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 ID:
321
        case 1: // ID
324
            if (field.type == TType.I64) {
322
          if (field.type == org.apache.thrift.protocol.TType.I64) {
325
              this.id = iprot.readI64();
323
            this.id = iprot.readI64();
326
              setIdIsSet(true);
324
            setIdIsSet(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 MESSAGE:
329
        case 2: // MESSAGE
332
            if (field.type == TType.STRING) {
330
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
333
              this.message = iprot.readString();
331
            this.message = 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(ID_FIELD_DESC);
349
    oprot.writeFieldBegin(ID_FIELD_DESC);
351
    oprot.writeI64(this.id);
350
    oprot.writeI64(this.id);
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