Subversion Repositories SmartDukaan

Rev

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

Rev 1013 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.payments;
6
package in.shop2020.payments;
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 Attribute implements org.apache.thrift.TBase<Attribute, Attribute._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("Attribute");
25
 
25
 
26
public class Attribute implements TBase<Attribute._Fields>, java.io.Serializable, Cloneable, Comparable<Attribute> {
26
  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)1);
27
  private static final TStruct STRUCT_DESC = new TStruct("Attribute");
27
  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)2);
28
 
28
 
29
  private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)1);
-
 
30
  private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)2);
-
 
31
 
-
 
32
  private String name;
29
  private String name; // required
33
  private String value;
30
  private String value; // 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
    NAME((short)1, "name"),
34
    NAME((short)1, "name"),
38
    VALUE((short)2, "value");
35
    VALUE((short)2, "value");
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: // NAME
-
 
51
          return NAME;
-
 
52
        case 2: // VALUE
-
 
53
          return VALUE;
-
 
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 88... Line 90...
88
    }
90
    }
89
  }
91
  }
90
 
92
 
91
  // isset id assignments
93
  // isset id assignments
92
 
94
 
93
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
95
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
94
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
-
 
95
        new FieldValueMetaData(TType.STRING)));
-
 
96
    put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, 
-
 
97
        new FieldValueMetaData(TType.STRING)));
-
 
98
  }});
-
 
99
 
-
 
100
  static {
96
  static {
-
 
97
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
98
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
99
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
100
    tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
101
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
102
    metaDataMap = Collections.unmodifiableMap(tmpMap);
101
    FieldMetaData.addStructMetaDataMap(Attribute.class, metaDataMap);
103
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Attribute.class, metaDataMap);
102
  }
104
  }
103
 
105
 
104
  public Attribute() {
106
  public Attribute() {
105
  }
107
  }
106
 
108
 
Line 127... Line 129...
127
 
129
 
128
  public Attribute deepCopy() {
130
  public Attribute deepCopy() {
129
    return new Attribute(this);
131
    return new Attribute(this);
130
  }
132
  }
131
 
133
 
132
  @Deprecated
134
  @Override
133
  public Attribute clone() {
135
  public void clear() {
134
    return new Attribute(this);
136
    this.name = null;
-
 
137
    this.value = null;
135
  }
138
  }
136
 
139
 
137
  public String getName() {
140
  public String getName() {
138
    return this.name;
141
    return this.name;
139
  }
142
  }
140
 
143
 
141
  public Attribute setName(String name) {
144
  public void setName(String name) {
142
    this.name = name;
145
    this.name = name;
143
    return this;
-
 
144
  }
146
  }
145
 
147
 
146
  public void unsetName() {
148
  public void unsetName() {
147
    this.name = null;
149
    this.name = null;
148
  }
150
  }
149
 
151
 
150
  /** Returns true if field name is set (has been asigned a value) and false otherwise */
152
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
151
  public boolean isSetName() {
153
  public boolean isSetName() {
152
    return this.name != null;
154
    return this.name != null;
153
  }
155
  }
154
 
156
 
155
  public void setNameIsSet(boolean value) {
157
  public void setNameIsSet(boolean value) {
Line 160... Line 162...
160
 
162
 
161
  public String getValue() {
163
  public String getValue() {
162
    return this.value;
164
    return this.value;
163
  }
165
  }
164
 
166
 
165
  public Attribute setValue(String value) {
167
  public void setValue(String value) {
166
    this.value = value;
168
    this.value = value;
167
    return this;
-
 
168
  }
169
  }
169
 
170
 
170
  public void unsetValue() {
171
  public void unsetValue() {
171
    this.value = null;
172
    this.value = null;
172
  }
173
  }
173
 
174
 
174
  /** Returns true if field value is set (has been asigned a value) and false otherwise */
175
  /** Returns true if field value is set (has been assigned a value) and false otherwise */
175
  public boolean isSetValue() {
176
  public boolean isSetValue() {
176
    return this.value != null;
177
    return this.value != null;
177
  }
178
  }
178
 
179
 
179
  public void setValueIsSet(boolean value) {
180
  public void setValueIsSet(boolean value) {
Line 201... Line 202...
201
      break;
202
      break;
202
 
203
 
203
    }
204
    }
204
  }
205
  }
205
 
206
 
206
  public void setFieldValue(int fieldID, Object value) {
-
 
207
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
208
  }
-
 
209
 
-
 
210
  public Object getFieldValue(_Fields field) {
207
  public Object getFieldValue(_Fields field) {
211
    switch (field) {
208
    switch (field) {
212
    case NAME:
209
    case NAME:
213
      return getName();
210
      return getName();
214
 
211
 
Line 217... Line 214...
217
 
214
 
218
    }
215
    }
219
    throw new IllegalStateException();
216
    throw new IllegalStateException();
220
  }
217
  }
221
 
218
 
222
  public Object getFieldValue(int fieldId) {
-
 
223
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
224
  }
-
 
225
 
-
 
226
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
219
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
227
  public boolean isSet(_Fields field) {
220
  public boolean isSet(_Fields field) {
-
 
221
    if (field == null) {
-
 
222
      throw new IllegalArgumentException();
-
 
223
    }
-
 
224
 
228
    switch (field) {
225
    switch (field) {
229
    case NAME:
226
    case NAME:
230
      return isSetName();
227
      return isSetName();
231
    case VALUE:
228
    case VALUE:
232
      return isSetValue();
229
      return isSetValue();
233
    }
230
    }
234
    throw new IllegalStateException();
231
    throw new IllegalStateException();
235
  }
232
  }
236
 
233
 
237
  public boolean isSet(int fieldID) {
-
 
238
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
239
  }
-
 
240
 
-
 
241
  @Override
234
  @Override
242
  public boolean equals(Object that) {
235
  public boolean equals(Object that) {
243
    if (that == null)
236
    if (that == null)
244
      return false;
237
      return false;
245
    if (that instanceof Attribute)
238
    if (that instanceof Attribute)
Line 283... Line 276...
283
    }
276
    }
284
 
277
 
285
    int lastComparison = 0;
278
    int lastComparison = 0;
286
    Attribute typedOther = (Attribute)other;
279
    Attribute typedOther = (Attribute)other;
287
 
280
 
288
    lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
281
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
289
    if (lastComparison != 0) {
282
    if (lastComparison != 0) {
290
      return lastComparison;
283
      return lastComparison;
291
    }
284
    }
-
 
285
    if (isSetName()) {
292
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
286
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
293
    if (lastComparison != 0) {
287
      if (lastComparison != 0) {
294
      return lastComparison;
288
        return lastComparison;
-
 
289
      }
295
    }
290
    }
296
    lastComparison = Boolean.valueOf(isSetValue()).compareTo(isSetValue());
291
    lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue());
297
    if (lastComparison != 0) {
292
    if (lastComparison != 0) {
298
      return lastComparison;
293
      return lastComparison;
299
    }
294
    }
-
 
295
    if (isSetValue()) {
300
    lastComparison = TBaseHelper.compareTo(value, typedOther.value);
296
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value);
301
    if (lastComparison != 0) {
297
      if (lastComparison != 0) {
302
      return lastComparison;
298
        return lastComparison;
-
 
299
      }
303
    }
300
    }
304
    return 0;
301
    return 0;
305
  }
302
  }
306
 
303
 
-
 
304
  public _Fields fieldForId(int fieldId) {
-
 
305
    return _Fields.findByThriftId(fieldId);
-
 
306
  }
-
 
307
 
307
  public void read(TProtocol iprot) throws TException {
308
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
308
    TField field;
309
    org.apache.thrift.protocol.TField field;
309
    iprot.readStructBegin();
310
    iprot.readStructBegin();
310
    while (true)
311
    while (true)
311
    {
312
    {
312
      field = iprot.readFieldBegin();
313
      field = iprot.readFieldBegin();
313
      if (field.type == TType.STOP) { 
314
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
314
        break;
315
        break;
315
      }
316
      }
316
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
317
      if (fieldId == null) {
-
 
318
        TProtocolUtil.skip(iprot, field.type);
-
 
319
      } else {
-
 
320
        switch (fieldId) {
317
      switch (field.id) {
321
          case NAME:
318
        case 1: // NAME
322
            if (field.type == TType.STRING) {
319
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
323
              this.name = iprot.readString();
320
            this.name = iprot.readString();
324
            } else { 
321
          } else { 
325
              TProtocolUtil.skip(iprot, field.type);
322
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
326
            }
323
          }
327
            break;
324
          break;
328
          case VALUE:
325
        case 2: // VALUE
329
            if (field.type == TType.STRING) {
326
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
330
              this.value = iprot.readString();
327
            this.value = iprot.readString();
331
            } else { 
328
          } else { 
332
              TProtocolUtil.skip(iprot, field.type);
329
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
333
            }
330
          }
334
            break;
331
          break;
335
        }
332
        default:
336
        iprot.readFieldEnd();
333
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
337
      }
334
      }
-
 
335
      iprot.readFieldEnd();
338
    }
336
    }
339
    iprot.readStructEnd();
337
    iprot.readStructEnd();
340
    validate();
338
    validate();
341
  }
339
  }
342
 
340
 
343
  public void write(TProtocol oprot) throws TException {
341
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
344
    validate();
342
    validate();
345
 
343
 
346
    oprot.writeStructBegin(STRUCT_DESC);
344
    oprot.writeStructBegin(STRUCT_DESC);
347
    if (this.name != null) {
345
    if (this.name != null) {
348
      oprot.writeFieldBegin(NAME_FIELD_DESC);
346
      oprot.writeFieldBegin(NAME_FIELD_DESC);
Line 380... Line 378...
380
    first = false;
378
    first = false;
381
    sb.append(")");
379
    sb.append(")");
382
    return sb.toString();
380
    return sb.toString();
383
  }
381
  }
384
 
382
 
385
  public void validate() throws TException {
383
  public void validate() throws org.apache.thrift.TException {
386
    // check for required fields
384
    // check for required fields
387
  }
385
  }
388
 
386
 
-
 
387
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
388
    try {
-
 
389
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
390
    } catch (org.apache.thrift.TException te) {
-
 
391
      throw new java.io.IOException(te);
-
 
392
    }
-
 
393
  }
-
 
394
 
-
 
395
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
396
    try {
-
 
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
 
389
}
403
}
390
 
404