Subversion Repositories SmartDukaan

Rev

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

Rev 1982 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 for Promotion Service
24
 * Exceptions for Promotion Service
28
 */
25
 */
29
public class PromotionException extends Exception implements TBase<PromotionException._Fields>, java.io.Serializable, Cloneable, Comparable<PromotionException> {
26
public class PromotionException extends Exception implements org.apache.thrift.TBase<PromotionException, PromotionException._Fields>, java.io.Serializable, Cloneable {
30
  private static final TStruct STRUCT_DESC = new TStruct("PromotionException");
27
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PromotionException");
31
 
28
 
32
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
29
  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);
33
  private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)2);
30
  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);
34
 
31
 
35
  private long id;
32
  private long id; // required
36
  private String message;
33
  private String message; // 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
    ID((short)1, "id"),
37
    ID((short)1, "id"),
41
    MESSAGE((short)2, "message");
38
    MESSAGE((short)2, "message");
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: // ID
-
 
54
          return ID;
-
 
55
        case 2: // MESSAGE
-
 
56
          return MESSAGE;
-
 
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 __ID_ISSET_ID = 0;
97
  private static final int __ID_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.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
-
 
100
        new FieldValueMetaData(TType.I64)));
-
 
101
    put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, 
-
 
102
        new FieldValueMetaData(TType.STRING)));
-
 
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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
104
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
105
    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
106
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
107
    metaDataMap = Collections.unmodifiableMap(tmpMap);
106
    FieldMetaData.addStructMetaDataMap(PromotionException.class, metaDataMap);
108
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PromotionException.class, metaDataMap);
107
  }
109
  }
108
 
110
 
109
  public PromotionException() {
111
  public PromotionException() {
110
  }
112
  }
111
 
113
 
Line 133... Line 135...
133
 
135
 
134
  public PromotionException deepCopy() {
136
  public PromotionException deepCopy() {
135
    return new PromotionException(this);
137
    return new PromotionException(this);
136
  }
138
  }
137
 
139
 
138
  @Deprecated
140
  @Override
139
  public PromotionException clone() {
141
  public void clear() {
140
    return new PromotionException(this);
142
    setIdIsSet(false);
-
 
143
    this.id = 0;
-
 
144
    this.message = null;
141
  }
145
  }
142
 
146
 
143
  public long getId() {
147
  public long getId() {
144
    return this.id;
148
    return this.id;
145
  }
149
  }
146
 
150
 
147
  public PromotionException setId(long id) {
151
  public void setId(long id) {
148
    this.id = id;
152
    this.id = id;
149
    setIdIsSet(true);
153
    setIdIsSet(true);
150
    return this;
-
 
151
  }
154
  }
152
 
155
 
153
  public void unsetId() {
156
  public void unsetId() {
154
    __isset_bit_vector.clear(__ID_ISSET_ID);
157
    __isset_bit_vector.clear(__ID_ISSET_ID);
155
  }
158
  }
156
 
159
 
157
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
160
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
158
  public boolean isSetId() {
161
  public boolean isSetId() {
159
    return __isset_bit_vector.get(__ID_ISSET_ID);
162
    return __isset_bit_vector.get(__ID_ISSET_ID);
160
  }
163
  }
161
 
164
 
162
  public void setIdIsSet(boolean value) {
165
  public void setIdIsSet(boolean value) {
Line 165... Line 168...
165
 
168
 
166
  public String getMessage() {
169
  public String getMessage() {
167
    return this.message;
170
    return this.message;
168
  }
171
  }
169
 
172
 
170
  public PromotionException setMessage(String message) {
173
  public void setMessage(String message) {
171
    this.message = message;
174
    this.message = message;
172
    return this;
-
 
173
  }
175
  }
174
 
176
 
175
  public void unsetMessage() {
177
  public void unsetMessage() {
176
    this.message = null;
178
    this.message = null;
177
  }
179
  }
178
 
180
 
179
  /** Returns true if field message is set (has been asigned a value) and false otherwise */
181
  /** Returns true if field message is set (has been assigned a value) and false otherwise */
180
  public boolean isSetMessage() {
182
  public boolean isSetMessage() {
181
    return this.message != null;
183
    return this.message != null;
182
  }
184
  }
183
 
185
 
184
  public void setMessageIsSet(boolean value) {
186
  public void setMessageIsSet(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 ID:
215
    case ID:
218
      return new Long(getId());
216
      return Long.valueOf(getId());
219
 
217
 
220
    case MESSAGE:
218
    case MESSAGE:
221
      return getMessage();
219
      return getMessage();
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 ID:
232
    case ID:
235
      return isSetId();
233
      return isSetId();
236
    case MESSAGE:
234
    case MESSAGE:
237
      return isSetMessage();
235
      return isSetMessage();
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 PromotionException)
244
    if (that instanceof PromotionException)
Line 288... Line 282...
288
    }
282
    }
289
 
283
 
290
    int lastComparison = 0;
284
    int lastComparison = 0;
291
    PromotionException typedOther = (PromotionException)other;
285
    PromotionException typedOther = (PromotionException)other;
292
 
286
 
293
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
287
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
294
    if (lastComparison != 0) {
288
    if (lastComparison != 0) {
295
      return lastComparison;
289
      return lastComparison;
296
    }
290
    }
-
 
291
    if (isSetId()) {
297
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
292
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
298
    if (lastComparison != 0) {
293
      if (lastComparison != 0) {
299
      return lastComparison;
294
        return lastComparison;
-
 
295
      }
300
    }
296
    }
301
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage());
297
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
302
    if (lastComparison != 0) {
298
    if (lastComparison != 0) {
303
      return lastComparison;
299
      return lastComparison;
304
    }
300
    }
-
 
301
    if (isSetMessage()) {
305
    lastComparison = TBaseHelper.compareTo(message, typedOther.message);
302
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
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 ID:
324
        case 1: // ID
327
            if (field.type == TType.I64) {
325
          if (field.type == org.apache.thrift.protocol.TType.I64) {
328
              this.id = iprot.readI64();
326
            this.id = iprot.readI64();
329
              setIdIsSet(true);
327
            setIdIsSet(true);
330
            } else { 
328
          } else { 
331
              TProtocolUtil.skip(iprot, field.type);
329
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
332
            }
330
          }
333
            break;
331
          break;
334
          case MESSAGE:
332
        case 2: // MESSAGE
335
            if (field.type == TType.STRING) {
333
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
336
              this.message = iprot.readString();
334
            this.message = iprot.readString();
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
    oprot.writeFieldBegin(ID_FIELD_DESC);
352
    oprot.writeFieldBegin(ID_FIELD_DESC);
354
    oprot.writeI64(this.id);
353
    oprot.writeI64(this.id);
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