Subversion Repositories SmartDukaan

Rev

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

Rev 3430 Rev 4496
Line 21... Line 21...
21
import org.slf4j.LoggerFactory;
21
import org.slf4j.LoggerFactory;
22
 
22
 
23
public class WarehouseServiceException extends Exception implements org.apache.thrift.TBase<WarehouseServiceException, WarehouseServiceException._Fields>, java.io.Serializable, Cloneable {
23
public class WarehouseServiceException extends Exception implements org.apache.thrift.TBase<WarehouseServiceException, WarehouseServiceException._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WarehouseServiceException");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WarehouseServiceException");
25
 
25
 
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);
26
  private static final org.apache.thrift.protocol.TField EXCEPTION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("exceptionType", org.apache.thrift.protocol.TType.I32, (short)1);
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);
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 long id; // required
29
  private in.shop2020.generic.ExceptionType exceptionType; // required
30
  private String message; // required
30
  private String message; // required
31
 
31
 
32
  /** 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. */
33
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
33
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-
 
34
    /**
-
 
35
     * 
-
 
36
     * @see in.shop2020.generic.ExceptionType
-
 
37
     */
34
    ID((short)1, "id"),
38
    EXCEPTION_TYPE((short)1, "exceptionType"),
35
    MESSAGE((short)2, "message");
39
    MESSAGE((short)2, "message");
36
 
40
 
37
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
41
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
38
 
42
 
39
    static {
43
    static {
Line 45... Line 49...
45
    /**
49
    /**
46
     * Find the _Fields constant that matches fieldId, or null if its not found.
50
     * Find the _Fields constant that matches fieldId, or null if its not found.
47
     */
51
     */
48
    public static _Fields findByThriftId(int fieldId) {
52
    public static _Fields findByThriftId(int fieldId) {
49
      switch(fieldId) {
53
      switch(fieldId) {
50
        case 1: // ID
54
        case 1: // EXCEPTION_TYPE
51
          return ID;
55
          return EXCEPTION_TYPE;
52
        case 2: // MESSAGE
56
        case 2: // MESSAGE
53
          return MESSAGE;
57
          return MESSAGE;
54
        default:
58
        default:
55
          return null;
59
          return null;
56
      }
60
      }
Line 89... Line 93...
89
      return _fieldName;
93
      return _fieldName;
90
    }
94
    }
91
  }
95
  }
92
 
96
 
93
  // isset id assignments
97
  // isset id assignments
94
  private static final int __ID_ISSET_ID = 0;
-
 
95
  private BitSet __isset_bit_vector = new BitSet(1);
-
 
96
 
98
 
97
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
99
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
98
  static {
100
  static {
99
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
101
    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, 
102
    tmpMap.put(_Fields.EXCEPTION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("exceptionType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
101
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
103
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, in.shop2020.generic.ExceptionType.class)));
102
    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, 
104
    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)));
105
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
104
    metaDataMap = Collections.unmodifiableMap(tmpMap);
106
    metaDataMap = Collections.unmodifiableMap(tmpMap);
105
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WarehouseServiceException.class, metaDataMap);
107
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WarehouseServiceException.class, metaDataMap);
106
  }
108
  }
107
 
109
 
108
  public WarehouseServiceException() {
110
  public WarehouseServiceException() {
109
  }
111
  }
110
 
112
 
111
  public WarehouseServiceException(
113
  public WarehouseServiceException(
112
    long id,
114
    in.shop2020.generic.ExceptionType exceptionType,
113
    String message)
115
    String message)
114
  {
116
  {
115
    this();
117
    this();
116
    this.id = id;
118
    this.exceptionType = exceptionType;
117
    setIdIsSet(true);
-
 
118
    this.message = message;
119
    this.message = message;
119
  }
120
  }
120
 
121
 
121
  /**
122
  /**
122
   * Performs a deep copy on <i>other</i>.
123
   * Performs a deep copy on <i>other</i>.
123
   */
124
   */
124
  public WarehouseServiceException(WarehouseServiceException other) {
125
  public WarehouseServiceException(WarehouseServiceException other) {
125
    __isset_bit_vector.clear();
126
    if (other.isSetExceptionType()) {
126
    __isset_bit_vector.or(other.__isset_bit_vector);
127
      this.exceptionType = other.exceptionType;
127
    this.id = other.id;
128
    }
128
    if (other.isSetMessage()) {
129
    if (other.isSetMessage()) {
129
      this.message = other.message;
130
      this.message = other.message;
130
    }
131
    }
131
  }
132
  }
132
 
133
 
Line 134... Line 135...
134
    return new WarehouseServiceException(this);
135
    return new WarehouseServiceException(this);
135
  }
136
  }
136
 
137
 
137
  @Override
138
  @Override
138
  public void clear() {
139
  public void clear() {
139
    setIdIsSet(false);
-
 
140
    this.id = 0;
140
    this.exceptionType = null;
141
    this.message = null;
141
    this.message = null;
142
  }
142
  }
143
 
143
 
-
 
144
  /**
-
 
145
   * 
-
 
146
   * @see in.shop2020.generic.ExceptionType
-
 
147
   */
144
  public long getId() {
148
  public in.shop2020.generic.ExceptionType getExceptionType() {
145
    return this.id;
149
    return this.exceptionType;
146
  }
150
  }
147
 
151
 
-
 
152
  /**
-
 
153
   * 
148
  public void setId(long id) {
154
   * @see in.shop2020.generic.ExceptionType
149
    this.id = id;
155
   */
-
 
156
  public void setExceptionType(in.shop2020.generic.ExceptionType exceptionType) {
150
    setIdIsSet(true);
157
    this.exceptionType = exceptionType;
151
  }
158
  }
152
 
159
 
153
  public void unsetId() {
160
  public void unsetExceptionType() {
154
    __isset_bit_vector.clear(__ID_ISSET_ID);
161
    this.exceptionType = null;
155
  }
162
  }
156
 
163
 
157
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
164
  /** Returns true if field exceptionType is set (has been assigned a value) and false otherwise */
158
  public boolean isSetId() {
165
  public boolean isSetExceptionType() {
159
    return __isset_bit_vector.get(__ID_ISSET_ID);
166
    return this.exceptionType != null;
160
  }
167
  }
161
 
168
 
162
  public void setIdIsSet(boolean value) {
169
  public void setExceptionTypeIsSet(boolean value) {
-
 
170
    if (!value) {
163
    __isset_bit_vector.set(__ID_ISSET_ID, value);
171
      this.exceptionType = null;
-
 
172
    }
164
  }
173
  }
165
 
174
 
166
  public String getMessage() {
175
  public String getMessage() {
167
    return this.message;
176
    return this.message;
168
  }
177
  }
Line 186... Line 195...
186
    }
195
    }
187
  }
196
  }
188
 
197
 
189
  public void setFieldValue(_Fields field, Object value) {
198
  public void setFieldValue(_Fields field, Object value) {
190
    switch (field) {
199
    switch (field) {
191
    case ID:
200
    case EXCEPTION_TYPE:
192
      if (value == null) {
201
      if (value == null) {
193
        unsetId();
202
        unsetExceptionType();
194
      } else {
203
      } else {
195
        setId((Long)value);
204
        setExceptionType((in.shop2020.generic.ExceptionType)value);
196
      }
205
      }
197
      break;
206
      break;
198
 
207
 
199
    case MESSAGE:
208
    case MESSAGE:
200
      if (value == null) {
209
      if (value == null) {
Line 207... Line 216...
207
    }
216
    }
208
  }
217
  }
209
 
218
 
210
  public Object getFieldValue(_Fields field) {
219
  public Object getFieldValue(_Fields field) {
211
    switch (field) {
220
    switch (field) {
212
    case ID:
221
    case EXCEPTION_TYPE:
213
      return Long.valueOf(getId());
222
      return getExceptionType();
214
 
223
 
215
    case MESSAGE:
224
    case MESSAGE:
216
      return getMessage();
225
      return getMessage();
217
 
226
 
218
    }
227
    }
Line 224... Line 233...
224
    if (field == null) {
233
    if (field == null) {
225
      throw new IllegalArgumentException();
234
      throw new IllegalArgumentException();
226
    }
235
    }
227
 
236
 
228
    switch (field) {
237
    switch (field) {
229
    case ID:
238
    case EXCEPTION_TYPE:
230
      return isSetId();
239
      return isSetExceptionType();
231
    case MESSAGE:
240
    case MESSAGE:
232
      return isSetMessage();
241
      return isSetMessage();
233
    }
242
    }
234
    throw new IllegalStateException();
243
    throw new IllegalStateException();
235
  }
244
  }
Line 245... Line 254...
245
 
254
 
246
  public boolean equals(WarehouseServiceException that) {
255
  public boolean equals(WarehouseServiceException that) {
247
    if (that == null)
256
    if (that == null)
248
      return false;
257
      return false;
249
 
258
 
250
    boolean this_present_id = true;
259
    boolean this_present_exceptionType = true && this.isSetExceptionType();
251
    boolean that_present_id = true;
260
    boolean that_present_exceptionType = true && that.isSetExceptionType();
252
    if (this_present_id || that_present_id) {
261
    if (this_present_exceptionType || that_present_exceptionType) {
253
      if (!(this_present_id && that_present_id))
262
      if (!(this_present_exceptionType && that_present_exceptionType))
254
        return false;
263
        return false;
255
      if (this.id != that.id)
264
      if (!this.exceptionType.equals(that.exceptionType))
256
        return false;
265
        return false;
257
    }
266
    }
258
 
267
 
259
    boolean this_present_message = true && this.isSetMessage();
268
    boolean this_present_message = true && this.isSetMessage();
260
    boolean that_present_message = true && that.isSetMessage();
269
    boolean that_present_message = true && that.isSetMessage();
Line 279... Line 288...
279
    }
288
    }
280
 
289
 
281
    int lastComparison = 0;
290
    int lastComparison = 0;
282
    WarehouseServiceException typedOther = (WarehouseServiceException)other;
291
    WarehouseServiceException typedOther = (WarehouseServiceException)other;
283
 
292
 
284
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
293
    lastComparison = Boolean.valueOf(isSetExceptionType()).compareTo(typedOther.isSetExceptionType());
285
    if (lastComparison != 0) {
294
    if (lastComparison != 0) {
286
      return lastComparison;
295
      return lastComparison;
287
    }
296
    }
288
    if (isSetId()) {
297
    if (isSetExceptionType()) {
289
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
298
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.exceptionType, typedOther.exceptionType);
290
      if (lastComparison != 0) {
299
      if (lastComparison != 0) {
291
        return lastComparison;
300
        return lastComparison;
292
      }
301
      }
293
    }
302
    }
294
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
303
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
Line 316... Line 325...
316
      field = iprot.readFieldBegin();
325
      field = iprot.readFieldBegin();
317
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
326
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
318
        break;
327
        break;
319
      }
328
      }
320
      switch (field.id) {
329
      switch (field.id) {
321
        case 1: // ID
330
        case 1: // EXCEPTION_TYPE
322
          if (field.type == org.apache.thrift.protocol.TType.I64) {
331
          if (field.type == org.apache.thrift.protocol.TType.I32) {
323
            this.id = iprot.readI64();
332
            this.exceptionType = in.shop2020.generic.ExceptionType.findByValue(iprot.readI32());
324
            setIdIsSet(true);
-
 
325
          } else { 
333
          } else { 
326
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
334
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
327
          }
335
          }
328
          break;
336
          break;
329
        case 2: // MESSAGE
337
        case 2: // MESSAGE
Line 344... Line 352...
344
 
352
 
345
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
353
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
346
    validate();
354
    validate();
347
 
355
 
348
    oprot.writeStructBegin(STRUCT_DESC);
356
    oprot.writeStructBegin(STRUCT_DESC);
-
 
357
    if (this.exceptionType != null) {
349
    oprot.writeFieldBegin(ID_FIELD_DESC);
358
      oprot.writeFieldBegin(EXCEPTION_TYPE_FIELD_DESC);
350
    oprot.writeI64(this.id);
359
      oprot.writeI32(this.exceptionType.getValue());
351
    oprot.writeFieldEnd();
360
      oprot.writeFieldEnd();
-
 
361
    }
352
    if (this.message != null) {
362
    if (this.message != null) {
353
      oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
363
      oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
354
      oprot.writeString(this.message);
364
      oprot.writeString(this.message);
355
      oprot.writeFieldEnd();
365
      oprot.writeFieldEnd();
356
    }
366
    }
Line 361... Line 371...
361
  @Override
371
  @Override
362
  public String toString() {
372
  public String toString() {
363
    StringBuilder sb = new StringBuilder("WarehouseServiceException(");
373
    StringBuilder sb = new StringBuilder("WarehouseServiceException(");
364
    boolean first = true;
374
    boolean first = true;
365
 
375
 
-
 
376
    sb.append("exceptionType:");
-
 
377
    if (this.exceptionType == null) {
366
    sb.append("id:");
378
      sb.append("null");
-
 
379
    } else {
367
    sb.append(this.id);
380
      sb.append(this.exceptionType);
-
 
381
    }
368
    first = false;
382
    first = false;
369
    if (!first) sb.append(", ");
383
    if (!first) sb.append(", ");
370
    sb.append("message:");
384
    sb.append("message:");
371
    if (this.message == null) {
385
    if (this.message == null) {
372
      sb.append("null");
386
      sb.append("null");
Line 390... Line 404...
390
    }
404
    }
391
  }
405
  }
392
 
406
 
393
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
407
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
394
    try {
408
    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)));
409
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
398
    } catch (org.apache.thrift.TException te) {
410
    } catch (org.apache.thrift.TException te) {
399
      throw new java.io.IOException(te);
411
      throw new java.io.IOException(te);
400
    }
412
    }
401
  }
413
  }