Subversion Repositories SmartDukaan

Rev

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

Rev 1860 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
public class MasterAffiliate implements TBase<MasterAffiliate._Fields>, java.io.Serializable, Cloneable, Comparable<MasterAffiliate> {
23
public class MasterAffiliate implements org.apache.thrift.TBase<MasterAffiliate, MasterAffiliate._Fields>, java.io.Serializable, Cloneable {
27
  private static final TStruct STRUCT_DESC = new TStruct("MasterAffiliate");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MasterAffiliate");
28
 
25
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
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);
30
  private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2);
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);
31
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)3);
28
  private static final org.apache.thrift.protocol.TField ADDED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("addedOn", org.apache.thrift.protocol.TType.I64, (short)3);
32
 
29
 
33
  private long id;
30
  private long id; // required
34
  private String name;
31
  private String name; // required
35
  private long addedOn;
32
  private long addedOn; // required
36
 
33
 
37
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
38
  public enum _Fields implements TFieldIdEnum {
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
39
    ID((short)1, "id"),
36
    ID((short)1, "id"),
40
    NAME((short)2, "name"),
37
    NAME((short)2, "name"),
41
    ADDED_ON((short)3, "addedOn");
38
    ADDED_ON((short)3, "addedOn");
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: // NAME
-
 
56
          return NAME;
-
 
57
        case 3: // ADDED_ON
-
 
58
          return ADDED_ON;
-
 
59
        default:
-
 
60
          return null;
-
 
61
      }
58
    }
62
    }
59
 
63
 
60
    /**
64
    /**
61
     * Find the _Fields constant that matches fieldId, throwing an exception
65
     * Find the _Fields constant that matches fieldId, throwing an exception
62
     * if it is not found.
66
     * if it is not found.
Line 94... Line 98...
94
  // isset id assignments
98
  // isset id assignments
95
  private static final int __ID_ISSET_ID = 0;
99
  private static final int __ID_ISSET_ID = 0;
96
  private static final int __ADDEDON_ISSET_ID = 1;
100
  private static final int __ADDEDON_ISSET_ID = 1;
97
  private BitSet __isset_bit_vector = new BitSet(2);
101
  private BitSet __isset_bit_vector = new BitSet(2);
98
 
102
 
99
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
100
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
-
 
101
        new FieldValueMetaData(TType.I64)));
-
 
102
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
-
 
103
        new FieldValueMetaData(TType.STRING)));
-
 
104
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
-
 
105
        new FieldValueMetaData(TType.I64)));
-
 
106
  }});
-
 
107
 
-
 
108
  static {
104
  static {
-
 
105
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
106
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
107
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
108
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
109
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
110
    tmpMap.put(_Fields.ADDED_ON, new org.apache.thrift.meta_data.FieldMetaData("addedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
111
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
112
    metaDataMap = Collections.unmodifiableMap(tmpMap);
109
    FieldMetaData.addStructMetaDataMap(MasterAffiliate.class, metaDataMap);
113
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MasterAffiliate.class, metaDataMap);
110
  }
114
  }
111
 
115
 
112
  public MasterAffiliate() {
116
  public MasterAffiliate() {
113
  }
117
  }
114
 
118
 
Line 140... Line 144...
140
 
144
 
141
  public MasterAffiliate deepCopy() {
145
  public MasterAffiliate deepCopy() {
142
    return new MasterAffiliate(this);
146
    return new MasterAffiliate(this);
143
  }
147
  }
144
 
148
 
145
  @Deprecated
149
  @Override
146
  public MasterAffiliate clone() {
150
  public void clear() {
-
 
151
    setIdIsSet(false);
-
 
152
    this.id = 0;
-
 
153
    this.name = null;
147
    return new MasterAffiliate(this);
154
    setAddedOnIsSet(false);
-
 
155
    this.addedOn = 0;
148
  }
156
  }
149
 
157
 
150
  public long getId() {
158
  public long getId() {
151
    return this.id;
159
    return this.id;
152
  }
160
  }
153
 
161
 
154
  public MasterAffiliate setId(long id) {
162
  public void setId(long id) {
155
    this.id = id;
163
    this.id = id;
156
    setIdIsSet(true);
164
    setIdIsSet(true);
157
    return this;
-
 
158
  }
165
  }
159
 
166
 
160
  public void unsetId() {
167
  public void unsetId() {
161
    __isset_bit_vector.clear(__ID_ISSET_ID);
168
    __isset_bit_vector.clear(__ID_ISSET_ID);
162
  }
169
  }
163
 
170
 
164
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
171
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
165
  public boolean isSetId() {
172
  public boolean isSetId() {
166
    return __isset_bit_vector.get(__ID_ISSET_ID);
173
    return __isset_bit_vector.get(__ID_ISSET_ID);
167
  }
174
  }
168
 
175
 
169
  public void setIdIsSet(boolean value) {
176
  public void setIdIsSet(boolean value) {
Line 172... Line 179...
172
 
179
 
173
  public String getName() {
180
  public String getName() {
174
    return this.name;
181
    return this.name;
175
  }
182
  }
176
 
183
 
177
  public MasterAffiliate setName(String name) {
184
  public void setName(String name) {
178
    this.name = name;
185
    this.name = name;
179
    return this;
-
 
180
  }
186
  }
181
 
187
 
182
  public void unsetName() {
188
  public void unsetName() {
183
    this.name = null;
189
    this.name = null;
184
  }
190
  }
185
 
191
 
186
  /** Returns true if field name is set (has been asigned a value) and false otherwise */
192
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
187
  public boolean isSetName() {
193
  public boolean isSetName() {
188
    return this.name != null;
194
    return this.name != null;
189
  }
195
  }
190
 
196
 
191
  public void setNameIsSet(boolean value) {
197
  public void setNameIsSet(boolean value) {
Line 196... Line 202...
196
 
202
 
197
  public long getAddedOn() {
203
  public long getAddedOn() {
198
    return this.addedOn;
204
    return this.addedOn;
199
  }
205
  }
200
 
206
 
201
  public MasterAffiliate setAddedOn(long addedOn) {
207
  public void setAddedOn(long addedOn) {
202
    this.addedOn = addedOn;
208
    this.addedOn = addedOn;
203
    setAddedOnIsSet(true);
209
    setAddedOnIsSet(true);
204
    return this;
-
 
205
  }
210
  }
206
 
211
 
207
  public void unsetAddedOn() {
212
  public void unsetAddedOn() {
208
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
213
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
209
  }
214
  }
210
 
215
 
211
  /** Returns true if field addedOn is set (has been asigned a value) and false otherwise */
216
  /** Returns true if field addedOn is set (has been assigned a value) and false otherwise */
212
  public boolean isSetAddedOn() {
217
  public boolean isSetAddedOn() {
213
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
218
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
214
  }
219
  }
215
 
220
 
216
  public void setAddedOnIsSet(boolean value) {
221
  public void setAddedOnIsSet(boolean value) {
Line 244... Line 249...
244
      break;
249
      break;
245
 
250
 
246
    }
251
    }
247
  }
252
  }
248
 
253
 
249
  public void setFieldValue(int fieldID, Object value) {
-
 
250
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
251
  }
-
 
252
 
-
 
253
  public Object getFieldValue(_Fields field) {
254
  public Object getFieldValue(_Fields field) {
254
    switch (field) {
255
    switch (field) {
255
    case ID:
256
    case ID:
256
      return new Long(getId());
257
      return Long.valueOf(getId());
257
 
258
 
258
    case NAME:
259
    case NAME:
259
      return getName();
260
      return getName();
260
 
261
 
261
    case ADDED_ON:
262
    case ADDED_ON:
262
      return new Long(getAddedOn());
263
      return Long.valueOf(getAddedOn());
263
 
264
 
264
    }
265
    }
265
    throw new IllegalStateException();
266
    throw new IllegalStateException();
266
  }
267
  }
267
 
268
 
268
  public Object getFieldValue(int fieldId) {
-
 
269
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
270
  }
-
 
271
 
-
 
272
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
269
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
273
  public boolean isSet(_Fields field) {
270
  public boolean isSet(_Fields field) {
-
 
271
    if (field == null) {
-
 
272
      throw new IllegalArgumentException();
-
 
273
    }
-
 
274
 
274
    switch (field) {
275
    switch (field) {
275
    case ID:
276
    case ID:
276
      return isSetId();
277
      return isSetId();
277
    case NAME:
278
    case NAME:
278
      return isSetName();
279
      return isSetName();
Line 280... Line 281...
280
      return isSetAddedOn();
281
      return isSetAddedOn();
281
    }
282
    }
282
    throw new IllegalStateException();
283
    throw new IllegalStateException();
283
  }
284
  }
284
 
285
 
285
  public boolean isSet(int fieldID) {
-
 
286
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
287
  }
-
 
288
 
-
 
289
  @Override
286
  @Override
290
  public boolean equals(Object that) {
287
  public boolean equals(Object that) {
291
    if (that == null)
288
    if (that == null)
292
      return false;
289
      return false;
293
    if (that instanceof MasterAffiliate)
290
    if (that instanceof MasterAffiliate)
Line 340... Line 337...
340
    }
337
    }
341
 
338
 
342
    int lastComparison = 0;
339
    int lastComparison = 0;
343
    MasterAffiliate typedOther = (MasterAffiliate)other;
340
    MasterAffiliate typedOther = (MasterAffiliate)other;
344
 
341
 
345
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
342
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
346
    if (lastComparison != 0) {
343
    if (lastComparison != 0) {
347
      return lastComparison;
344
      return lastComparison;
348
    }
345
    }
-
 
346
    if (isSetId()) {
349
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
347
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
350
    if (lastComparison != 0) {
348
      if (lastComparison != 0) {
351
      return lastComparison;
349
        return lastComparison;
-
 
350
      }
352
    }
351
    }
353
    lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
352
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
354
    if (lastComparison != 0) {
353
    if (lastComparison != 0) {
355
      return lastComparison;
354
      return lastComparison;
356
    }
355
    }
-
 
356
    if (isSetName()) {
357
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
357
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
358
    if (lastComparison != 0) {
358
      if (lastComparison != 0) {
359
      return lastComparison;
359
        return lastComparison;
-
 
360
      }
360
    }
361
    }
361
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(isSetAddedOn());
362
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(typedOther.isSetAddedOn());
362
    if (lastComparison != 0) {
363
    if (lastComparison != 0) {
363
      return lastComparison;
364
      return lastComparison;
364
    }
365
    }
-
 
366
    if (isSetAddedOn()) {
365
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addedOn, typedOther.addedOn);
366
    if (lastComparison != 0) {
368
      if (lastComparison != 0) {
367
      return lastComparison;
369
        return lastComparison;
-
 
370
      }
368
    }
371
    }
369
    return 0;
372
    return 0;
370
  }
373
  }
371
 
374
 
-
 
375
  public _Fields fieldForId(int fieldId) {
-
 
376
    return _Fields.findByThriftId(fieldId);
-
 
377
  }
-
 
378
 
372
  public void read(TProtocol iprot) throws TException {
379
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
373
    TField field;
380
    org.apache.thrift.protocol.TField field;
374
    iprot.readStructBegin();
381
    iprot.readStructBegin();
375
    while (true)
382
    while (true)
376
    {
383
    {
377
      field = iprot.readFieldBegin();
384
      field = iprot.readFieldBegin();
378
      if (field.type == TType.STOP) { 
385
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
379
        break;
386
        break;
380
      }
387
      }
381
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
382
      if (fieldId == null) {
-
 
383
        TProtocolUtil.skip(iprot, field.type);
-
 
384
      } else {
-
 
385
        switch (fieldId) {
388
      switch (field.id) {
386
          case ID:
389
        case 1: // ID
387
            if (field.type == TType.I64) {
390
          if (field.type == org.apache.thrift.protocol.TType.I64) {
388
              this.id = iprot.readI64();
391
            this.id = iprot.readI64();
389
              setIdIsSet(true);
392
            setIdIsSet(true);
390
            } else { 
393
          } else { 
391
              TProtocolUtil.skip(iprot, field.type);
394
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
392
            }
395
          }
393
            break;
396
          break;
394
          case NAME:
397
        case 2: // NAME
395
            if (field.type == TType.STRING) {
398
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
396
              this.name = iprot.readString();
399
            this.name = iprot.readString();
397
            } else { 
400
          } else { 
398
              TProtocolUtil.skip(iprot, field.type);
401
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
399
            }
402
          }
400
            break;
403
          break;
401
          case ADDED_ON:
404
        case 3: // ADDED_ON
402
            if (field.type == TType.I64) {
405
          if (field.type == org.apache.thrift.protocol.TType.I64) {
403
              this.addedOn = iprot.readI64();
406
            this.addedOn = iprot.readI64();
404
              setAddedOnIsSet(true);
407
            setAddedOnIsSet(true);
405
            } else { 
408
          } else { 
406
              TProtocolUtil.skip(iprot, field.type);
409
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
407
            }
410
          }
408
            break;
411
          break;
409
        }
412
        default:
410
        iprot.readFieldEnd();
413
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
411
      }
414
      }
-
 
415
      iprot.readFieldEnd();
412
    }
416
    }
413
    iprot.readStructEnd();
417
    iprot.readStructEnd();
414
    validate();
418
    validate();
415
  }
419
  }
416
 
420
 
417
  public void write(TProtocol oprot) throws TException {
421
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
418
    validate();
422
    validate();
419
 
423
 
420
    oprot.writeStructBegin(STRUCT_DESC);
424
    oprot.writeStructBegin(STRUCT_DESC);
421
    oprot.writeFieldBegin(ID_FIELD_DESC);
425
    oprot.writeFieldBegin(ID_FIELD_DESC);
422
    oprot.writeI64(this.id);
426
    oprot.writeI64(this.id);
Line 455... Line 459...
455
    first = false;
459
    first = false;
456
    sb.append(")");
460
    sb.append(")");
457
    return sb.toString();
461
    return sb.toString();
458
  }
462
  }
459
 
463
 
460
  public void validate() throws TException {
464
  public void validate() throws org.apache.thrift.TException {
461
    // check for required fields
465
    // check for required fields
462
  }
466
  }
463
 
467
 
-
 
468
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
469
    try {
-
 
470
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
471
    } catch (org.apache.thrift.TException te) {
-
 
472
      throw new java.io.IOException(te);
-
 
473
    }
-
 
474
  }
-
 
475
 
-
 
476
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
477
    try {
-
 
478
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
479
      __isset_bit_vector = new BitSet(1);
-
 
480
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
481
    } catch (org.apache.thrift.TException te) {
-
 
482
      throw new java.io.IOException(te);
-
 
483
    }
-
 
484
  }
-
 
485
 
464
}
486
}
465
 
487