Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20744 kshitij.so 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.logistics;
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
public class BluedartAttributes implements org.apache.thrift.TBase<BluedartAttributes, BluedartAttributes._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BluedartAttributes");
25
 
26
  private static final org.apache.thrift.protocol.TField LOGISTICS_TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("logisticsTransactionId", org.apache.thrift.protocol.TType.STRING, (short)1);
27
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)3);
29
 
30
  private String logisticsTransactionId; // required
31
  private String name; // required
32
  private String value; // required
33
 
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
36
    LOGISTICS_TRANSACTION_ID((short)1, "logisticsTransactionId"),
37
    NAME((short)2, "name"),
38
    VALUE((short)3, "value");
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: // LOGISTICS_TRANSACTION_ID
54
          return LOGISTICS_TRANSACTION_ID;
55
        case 2: // NAME
56
          return NAME;
57
        case 3: // VALUE
58
          return VALUE;
59
        default:
60
          return null;
61
      }
62
    }
63
 
64
    /**
65
     * Find the _Fields constant that matches fieldId, throwing an exception
66
     * if it is not found.
67
     */
68
    public static _Fields findByThriftIdOrThrow(int fieldId) {
69
      _Fields fields = findByThriftId(fieldId);
70
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
71
      return fields;
72
    }
73
 
74
    /**
75
     * Find the _Fields constant that matches name, or null if its not found.
76
     */
77
    public static _Fields findByName(String name) {
78
      return byName.get(name);
79
    }
80
 
81
    private final short _thriftId;
82
    private final String _fieldName;
83
 
84
    _Fields(short thriftId, String fieldName) {
85
      _thriftId = thriftId;
86
      _fieldName = fieldName;
87
    }
88
 
89
    public short getThriftFieldId() {
90
      return _thriftId;
91
    }
92
 
93
    public String getFieldName() {
94
      return _fieldName;
95
    }
96
  }
97
 
98
  // isset id assignments
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.LOGISTICS_TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("logisticsTransactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
104
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
105
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
106
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
107
    tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, 
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
109
    metaDataMap = Collections.unmodifiableMap(tmpMap);
110
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BluedartAttributes.class, metaDataMap);
111
  }
112
 
113
  public BluedartAttributes() {
114
  }
115
 
116
  public BluedartAttributes(
117
    String logisticsTransactionId,
118
    String name,
119
    String value)
120
  {
121
    this();
122
    this.logisticsTransactionId = logisticsTransactionId;
123
    this.name = name;
124
    this.value = value;
125
  }
126
 
127
  /**
128
   * Performs a deep copy on <i>other</i>.
129
   */
130
  public BluedartAttributes(BluedartAttributes other) {
131
    if (other.isSetLogisticsTransactionId()) {
132
      this.logisticsTransactionId = other.logisticsTransactionId;
133
    }
134
    if (other.isSetName()) {
135
      this.name = other.name;
136
    }
137
    if (other.isSetValue()) {
138
      this.value = other.value;
139
    }
140
  }
141
 
142
  public BluedartAttributes deepCopy() {
143
    return new BluedartAttributes(this);
144
  }
145
 
146
  @Override
147
  public void clear() {
148
    this.logisticsTransactionId = null;
149
    this.name = null;
150
    this.value = null;
151
  }
152
 
153
  public String getLogisticsTransactionId() {
154
    return this.logisticsTransactionId;
155
  }
156
 
157
  public void setLogisticsTransactionId(String logisticsTransactionId) {
158
    this.logisticsTransactionId = logisticsTransactionId;
159
  }
160
 
161
  public void unsetLogisticsTransactionId() {
162
    this.logisticsTransactionId = null;
163
  }
164
 
165
  /** Returns true if field logisticsTransactionId is set (has been assigned a value) and false otherwise */
166
  public boolean isSetLogisticsTransactionId() {
167
    return this.logisticsTransactionId != null;
168
  }
169
 
170
  public void setLogisticsTransactionIdIsSet(boolean value) {
171
    if (!value) {
172
      this.logisticsTransactionId = null;
173
    }
174
  }
175
 
176
  public String getName() {
177
    return this.name;
178
  }
179
 
180
  public void setName(String name) {
181
    this.name = name;
182
  }
183
 
184
  public void unsetName() {
185
    this.name = null;
186
  }
187
 
188
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
189
  public boolean isSetName() {
190
    return this.name != null;
191
  }
192
 
193
  public void setNameIsSet(boolean value) {
194
    if (!value) {
195
      this.name = null;
196
    }
197
  }
198
 
199
  public String getValue() {
200
    return this.value;
201
  }
202
 
203
  public void setValue(String value) {
204
    this.value = value;
205
  }
206
 
207
  public void unsetValue() {
208
    this.value = null;
209
  }
210
 
211
  /** Returns true if field value is set (has been assigned a value) and false otherwise */
212
  public boolean isSetValue() {
213
    return this.value != null;
214
  }
215
 
216
  public void setValueIsSet(boolean value) {
217
    if (!value) {
218
      this.value = null;
219
    }
220
  }
221
 
222
  public void setFieldValue(_Fields field, Object value) {
223
    switch (field) {
224
    case LOGISTICS_TRANSACTION_ID:
225
      if (value == null) {
226
        unsetLogisticsTransactionId();
227
      } else {
228
        setLogisticsTransactionId((String)value);
229
      }
230
      break;
231
 
232
    case NAME:
233
      if (value == null) {
234
        unsetName();
235
      } else {
236
        setName((String)value);
237
      }
238
      break;
239
 
240
    case VALUE:
241
      if (value == null) {
242
        unsetValue();
243
      } else {
244
        setValue((String)value);
245
      }
246
      break;
247
 
248
    }
249
  }
250
 
251
  public Object getFieldValue(_Fields field) {
252
    switch (field) {
253
    case LOGISTICS_TRANSACTION_ID:
254
      return getLogisticsTransactionId();
255
 
256
    case NAME:
257
      return getName();
258
 
259
    case VALUE:
260
      return getValue();
261
 
262
    }
263
    throw new IllegalStateException();
264
  }
265
 
266
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
267
  public boolean isSet(_Fields field) {
268
    if (field == null) {
269
      throw new IllegalArgumentException();
270
    }
271
 
272
    switch (field) {
273
    case LOGISTICS_TRANSACTION_ID:
274
      return isSetLogisticsTransactionId();
275
    case NAME:
276
      return isSetName();
277
    case VALUE:
278
      return isSetValue();
279
    }
280
    throw new IllegalStateException();
281
  }
282
 
283
  @Override
284
  public boolean equals(Object that) {
285
    if (that == null)
286
      return false;
287
    if (that instanceof BluedartAttributes)
288
      return this.equals((BluedartAttributes)that);
289
    return false;
290
  }
291
 
292
  public boolean equals(BluedartAttributes that) {
293
    if (that == null)
294
      return false;
295
 
296
    boolean this_present_logisticsTransactionId = true && this.isSetLogisticsTransactionId();
297
    boolean that_present_logisticsTransactionId = true && that.isSetLogisticsTransactionId();
298
    if (this_present_logisticsTransactionId || that_present_logisticsTransactionId) {
299
      if (!(this_present_logisticsTransactionId && that_present_logisticsTransactionId))
300
        return false;
301
      if (!this.logisticsTransactionId.equals(that.logisticsTransactionId))
302
        return false;
303
    }
304
 
305
    boolean this_present_name = true && this.isSetName();
306
    boolean that_present_name = true && that.isSetName();
307
    if (this_present_name || that_present_name) {
308
      if (!(this_present_name && that_present_name))
309
        return false;
310
      if (!this.name.equals(that.name))
311
        return false;
312
    }
313
 
314
    boolean this_present_value = true && this.isSetValue();
315
    boolean that_present_value = true && that.isSetValue();
316
    if (this_present_value || that_present_value) {
317
      if (!(this_present_value && that_present_value))
318
        return false;
319
      if (!this.value.equals(that.value))
320
        return false;
321
    }
322
 
323
    return true;
324
  }
325
 
326
  @Override
327
  public int hashCode() {
328
    return 0;
329
  }
330
 
331
  public int compareTo(BluedartAttributes other) {
332
    if (!getClass().equals(other.getClass())) {
333
      return getClass().getName().compareTo(other.getClass().getName());
334
    }
335
 
336
    int lastComparison = 0;
337
    BluedartAttributes typedOther = (BluedartAttributes)other;
338
 
339
    lastComparison = Boolean.valueOf(isSetLogisticsTransactionId()).compareTo(typedOther.isSetLogisticsTransactionId());
340
    if (lastComparison != 0) {
341
      return lastComparison;
342
    }
343
    if (isSetLogisticsTransactionId()) {
344
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.logisticsTransactionId, typedOther.logisticsTransactionId);
345
      if (lastComparison != 0) {
346
        return lastComparison;
347
      }
348
    }
349
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
350
    if (lastComparison != 0) {
351
      return lastComparison;
352
    }
353
    if (isSetName()) {
354
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
355
      if (lastComparison != 0) {
356
        return lastComparison;
357
      }
358
    }
359
    lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());
360
    if (lastComparison != 0) {
361
      return lastComparison;
362
    }
363
    if (isSetValue()) {
364
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value);
365
      if (lastComparison != 0) {
366
        return lastComparison;
367
      }
368
    }
369
    return 0;
370
  }
371
 
372
  public _Fields fieldForId(int fieldId) {
373
    return _Fields.findByThriftId(fieldId);
374
  }
375
 
376
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
377
    org.apache.thrift.protocol.TField field;
378
    iprot.readStructBegin();
379
    while (true)
380
    {
381
      field = iprot.readFieldBegin();
382
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
383
        break;
384
      }
385
      switch (field.id) {
386
        case 1: // LOGISTICS_TRANSACTION_ID
387
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
388
            this.logisticsTransactionId = iprot.readString();
389
          } else { 
390
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
391
          }
392
          break;
393
        case 2: // NAME
394
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
395
            this.name = iprot.readString();
396
          } else { 
397
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
398
          }
399
          break;
400
        case 3: // VALUE
401
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
402
            this.value = iprot.readString();
403
          } else { 
404
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
405
          }
406
          break;
407
        default:
408
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
409
      }
410
      iprot.readFieldEnd();
411
    }
412
    iprot.readStructEnd();
413
    validate();
414
  }
415
 
416
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
417
    validate();
418
 
419
    oprot.writeStructBegin(STRUCT_DESC);
420
    if (this.logisticsTransactionId != null) {
421
      oprot.writeFieldBegin(LOGISTICS_TRANSACTION_ID_FIELD_DESC);
422
      oprot.writeString(this.logisticsTransactionId);
423
      oprot.writeFieldEnd();
424
    }
425
    if (this.name != null) {
426
      oprot.writeFieldBegin(NAME_FIELD_DESC);
427
      oprot.writeString(this.name);
428
      oprot.writeFieldEnd();
429
    }
430
    if (this.value != null) {
431
      oprot.writeFieldBegin(VALUE_FIELD_DESC);
432
      oprot.writeString(this.value);
433
      oprot.writeFieldEnd();
434
    }
435
    oprot.writeFieldStop();
436
    oprot.writeStructEnd();
437
  }
438
 
439
  @Override
440
  public String toString() {
441
    StringBuilder sb = new StringBuilder("BluedartAttributes(");
442
    boolean first = true;
443
 
444
    sb.append("logisticsTransactionId:");
445
    if (this.logisticsTransactionId == null) {
446
      sb.append("null");
447
    } else {
448
      sb.append(this.logisticsTransactionId);
449
    }
450
    first = false;
451
    if (!first) sb.append(", ");
452
    sb.append("name:");
453
    if (this.name == null) {
454
      sb.append("null");
455
    } else {
456
      sb.append(this.name);
457
    }
458
    first = false;
459
    if (!first) sb.append(", ");
460
    sb.append("value:");
461
    if (this.value == null) {
462
      sb.append("null");
463
    } else {
464
      sb.append(this.value);
465
    }
466
    first = false;
467
    sb.append(")");
468
    return sb.toString();
469
  }
470
 
471
  public void validate() throws org.apache.thrift.TException {
472
    // check for required fields
473
  }
474
 
475
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
476
    try {
477
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
478
    } catch (org.apache.thrift.TException te) {
479
      throw new java.io.IOException(te);
480
    }
481
  }
482
 
483
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
484
    try {
485
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
486
    } catch (org.apache.thrift.TException te) {
487
      throw new java.io.IOException(te);
488
    }
489
  }
490
 
491
}
492