Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9048 manish.sha 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.googleadwords;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
/**
24
 * Exceptions
25
 */
26
public class GoogleAdwordsServiceException extends Exception implements org.apache.thrift.TBase<GoogleAdwordsServiceException, GoogleAdwordsServiceException._Fields>, java.io.Serializable, Cloneable {
27
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GoogleAdwordsServiceException");
28
 
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);
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);
31
 
32
  private long id; // required
33
  private String message; // required
34
 
35
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
37
    ID((short)1, "id"),
38
    MESSAGE((short)2, "message");
39
 
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
41
 
42
    static {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
44
        byName.put(field.getFieldName(), field);
45
      }
46
    }
47
 
48
    /**
49
     * Find the _Fields constant that matches fieldId, or null if its not found.
50
     */
51
    public static _Fields findByThriftId(int fieldId) {
52
      switch(fieldId) {
53
        case 1: // ID
54
          return ID;
55
        case 2: // MESSAGE
56
          return MESSAGE;
57
        default:
58
          return null;
59
      }
60
    }
61
 
62
    /**
63
     * Find the _Fields constant that matches fieldId, throwing an exception
64
     * if it is not found.
65
     */
66
    public static _Fields findByThriftIdOrThrow(int fieldId) {
67
      _Fields fields = findByThriftId(fieldId);
68
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
69
      return fields;
70
    }
71
 
72
    /**
73
     * Find the _Fields constant that matches name, or null if its not found.
74
     */
75
    public static _Fields findByName(String name) {
76
      return byName.get(name);
77
    }
78
 
79
    private final short _thriftId;
80
    private final String _fieldName;
81
 
82
    _Fields(short thriftId, String fieldName) {
83
      _thriftId = thriftId;
84
      _fieldName = fieldName;
85
    }
86
 
87
    public short getThriftFieldId() {
88
      return _thriftId;
89
    }
90
 
91
    public String getFieldName() {
92
      return _fieldName;
93
    }
94
  }
95
 
96
  // isset id assignments
97
  private static final int __ID_ISSET_ID = 0;
98
  private BitSet __isset_bit_vector = new BitSet(1);
99
 
100
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
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);
108
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GoogleAdwordsServiceException.class, metaDataMap);
109
  }
110
 
111
  public GoogleAdwordsServiceException() {
112
  }
113
 
114
  public GoogleAdwordsServiceException(
115
    long id,
116
    String message)
117
  {
118
    this();
119
    this.id = id;
120
    setIdIsSet(true);
121
    this.message = message;
122
  }
123
 
124
  /**
125
   * Performs a deep copy on <i>other</i>.
126
   */
127
  public GoogleAdwordsServiceException(GoogleAdwordsServiceException other) {
128
    __isset_bit_vector.clear();
129
    __isset_bit_vector.or(other.__isset_bit_vector);
130
    this.id = other.id;
131
    if (other.isSetMessage()) {
132
      this.message = other.message;
133
    }
134
  }
135
 
136
  public GoogleAdwordsServiceException deepCopy() {
137
    return new GoogleAdwordsServiceException(this);
138
  }
139
 
140
  @Override
141
  public void clear() {
142
    setIdIsSet(false);
143
    this.id = 0;
144
    this.message = null;
145
  }
146
 
147
  public long getId() {
148
    return this.id;
149
  }
150
 
151
  public void setId(long id) {
152
    this.id = id;
153
    setIdIsSet(true);
154
  }
155
 
156
  public void unsetId() {
157
    __isset_bit_vector.clear(__ID_ISSET_ID);
158
  }
159
 
160
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
161
  public boolean isSetId() {
162
    return __isset_bit_vector.get(__ID_ISSET_ID);
163
  }
164
 
165
  public void setIdIsSet(boolean value) {
166
    __isset_bit_vector.set(__ID_ISSET_ID, value);
167
  }
168
 
169
  public String getMessage() {
170
    return this.message;
171
  }
172
 
173
  public void setMessage(String message) {
174
    this.message = message;
175
  }
176
 
177
  public void unsetMessage() {
178
    this.message = null;
179
  }
180
 
181
  /** Returns true if field message is set (has been assigned a value) and false otherwise */
182
  public boolean isSetMessage() {
183
    return this.message != null;
184
  }
185
 
186
  public void setMessageIsSet(boolean value) {
187
    if (!value) {
188
      this.message = null;
189
    }
190
  }
191
 
192
  public void setFieldValue(_Fields field, Object value) {
193
    switch (field) {
194
    case ID:
195
      if (value == null) {
196
        unsetId();
197
      } else {
198
        setId((Long)value);
199
      }
200
      break;
201
 
202
    case MESSAGE:
203
      if (value == null) {
204
        unsetMessage();
205
      } else {
206
        setMessage((String)value);
207
      }
208
      break;
209
 
210
    }
211
  }
212
 
213
  public Object getFieldValue(_Fields field) {
214
    switch (field) {
215
    case ID:
216
      return Long.valueOf(getId());
217
 
218
    case MESSAGE:
219
      return getMessage();
220
 
221
    }
222
    throw new IllegalStateException();
223
  }
224
 
225
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
226
  public boolean isSet(_Fields field) {
227
    if (field == null) {
228
      throw new IllegalArgumentException();
229
    }
230
 
231
    switch (field) {
232
    case ID:
233
      return isSetId();
234
    case MESSAGE:
235
      return isSetMessage();
236
    }
237
    throw new IllegalStateException();
238
  }
239
 
240
  @Override
241
  public boolean equals(Object that) {
242
    if (that == null)
243
      return false;
244
    if (that instanceof GoogleAdwordsServiceException)
245
      return this.equals((GoogleAdwordsServiceException)that);
246
    return false;
247
  }
248
 
249
  public boolean equals(GoogleAdwordsServiceException that) {
250
    if (that == null)
251
      return false;
252
 
253
    boolean this_present_id = true;
254
    boolean that_present_id = true;
255
    if (this_present_id || that_present_id) {
256
      if (!(this_present_id && that_present_id))
257
        return false;
258
      if (this.id != that.id)
259
        return false;
260
    }
261
 
262
    boolean this_present_message = true && this.isSetMessage();
263
    boolean that_present_message = true && that.isSetMessage();
264
    if (this_present_message || that_present_message) {
265
      if (!(this_present_message && that_present_message))
266
        return false;
267
      if (!this.message.equals(that.message))
268
        return false;
269
    }
270
 
271
    return true;
272
  }
273
 
274
  @Override
275
  public int hashCode() {
276
    return 0;
277
  }
278
 
279
  public int compareTo(GoogleAdwordsServiceException other) {
280
    if (!getClass().equals(other.getClass())) {
281
      return getClass().getName().compareTo(other.getClass().getName());
282
    }
283
 
284
    int lastComparison = 0;
285
    GoogleAdwordsServiceException typedOther = (GoogleAdwordsServiceException)other;
286
 
287
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
288
    if (lastComparison != 0) {
289
      return lastComparison;
290
    }
291
    if (isSetId()) {
292
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
293
      if (lastComparison != 0) {
294
        return lastComparison;
295
      }
296
    }
297
    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
298
    if (lastComparison != 0) {
299
      return lastComparison;
300
    }
301
    if (isSetMessage()) {
302
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
303
      if (lastComparison != 0) {
304
        return lastComparison;
305
      }
306
    }
307
    return 0;
308
  }
309
 
310
  public _Fields fieldForId(int fieldId) {
311
    return _Fields.findByThriftId(fieldId);
312
  }
313
 
314
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
315
    org.apache.thrift.protocol.TField field;
316
    iprot.readStructBegin();
317
    while (true)
318
    {
319
      field = iprot.readFieldBegin();
320
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
321
        break;
322
      }
323
      switch (field.id) {
324
        case 1: // ID
325
          if (field.type == org.apache.thrift.protocol.TType.I64) {
326
            this.id = iprot.readI64();
327
            setIdIsSet(true);
328
          } else { 
329
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
330
          }
331
          break;
332
        case 2: // MESSAGE
333
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
334
            this.message = iprot.readString();
335
          } else { 
336
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
337
          }
338
          break;
339
        default:
340
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
341
      }
342
      iprot.readFieldEnd();
343
    }
344
    iprot.readStructEnd();
345
    validate();
346
  }
347
 
348
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
349
    validate();
350
 
351
    oprot.writeStructBegin(STRUCT_DESC);
352
    oprot.writeFieldBegin(ID_FIELD_DESC);
353
    oprot.writeI64(this.id);
354
    oprot.writeFieldEnd();
355
    if (this.message != null) {
356
      oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
357
      oprot.writeString(this.message);
358
      oprot.writeFieldEnd();
359
    }
360
    oprot.writeFieldStop();
361
    oprot.writeStructEnd();
362
  }
363
 
364
  @Override
365
  public String toString() {
366
    StringBuilder sb = new StringBuilder("GoogleAdwordsServiceException(");
367
    boolean first = true;
368
 
369
    sb.append("id:");
370
    sb.append(this.id);
371
    first = false;
372
    if (!first) sb.append(", ");
373
    sb.append("message:");
374
    if (this.message == null) {
375
      sb.append("null");
376
    } else {
377
      sb.append(this.message);
378
    }
379
    first = false;
380
    sb.append(")");
381
    return sb.toString();
382
  }
383
 
384
  public void validate() throws org.apache.thrift.TException {
385
    // check for required fields
386
  }
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
 
406
}
407