Subversion Repositories SmartDukaan

Rev

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

Rev 1998 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.*;
23
public class Tracker implements org.apache.thrift.TBase<Tracker, Tracker._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("Tracker");
25
 
25
 
26
public class Tracker implements TBase<Tracker._Fields>, java.io.Serializable, Cloneable, Comparable<Tracker> {
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);
27
  private static final TStruct STRUCT_DESC = new TStruct("Tracker");
27
  private static final org.apache.thrift.protocol.TField AFFILIATE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("affiliateId", org.apache.thrift.protocol.TType.I64, (short)2);
28
 
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
-
 
30
  private static final TField AFFILIATE_ID_FIELD_DESC = new TField("affiliateId", TType.I64, (short)2);
-
 
31
 
-
 
32
  private long id;
29
  private long id; // required
33
  private long affiliateId;
30
  private long affiliateId; // 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
    ID((short)1, "id"),
34
    ID((short)1, "id"),
38
    AFFILIATE_ID((short)2, "affiliateId");
35
    AFFILIATE_ID((short)2, "affiliateId");
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: // ID
-
 
51
          return ID;
-
 
52
        case 2: // AFFILIATE_ID
-
 
53
          return AFFILIATE_ID;
-
 
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 91... Line 93...
91
  // isset id assignments
93
  // isset id assignments
92
  private static final int __ID_ISSET_ID = 0;
94
  private static final int __ID_ISSET_ID = 0;
93
  private static final int __AFFILIATEID_ISSET_ID = 1;
95
  private static final int __AFFILIATEID_ISSET_ID = 1;
94
  private BitSet __isset_bit_vector = new BitSet(2);
96
  private BitSet __isset_bit_vector = new BitSet(2);
95
 
97
 
96
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
98
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
97
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
-
 
98
        new FieldValueMetaData(TType.I64)));
-
 
99
    put(_Fields.AFFILIATE_ID, new FieldMetaData("affiliateId", TFieldRequirementType.DEFAULT, 
-
 
100
        new FieldValueMetaData(TType.I64)));
-
 
101
  }});
-
 
102
 
-
 
103
  static {
99
  static {
-
 
100
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
101
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
102
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
103
    tmpMap.put(_Fields.AFFILIATE_ID, new org.apache.thrift.meta_data.FieldMetaData("affiliateId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
104
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
105
    metaDataMap = Collections.unmodifiableMap(tmpMap);
104
    FieldMetaData.addStructMetaDataMap(Tracker.class, metaDataMap);
106
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Tracker.class, metaDataMap);
105
  }
107
  }
106
 
108
 
107
  public Tracker() {
109
  public Tracker() {
108
  }
110
  }
109
 
111
 
Line 130... Line 132...
130
 
132
 
131
  public Tracker deepCopy() {
133
  public Tracker deepCopy() {
132
    return new Tracker(this);
134
    return new Tracker(this);
133
  }
135
  }
134
 
136
 
135
  @Deprecated
137
  @Override
136
  public Tracker clone() {
138
  public void clear() {
-
 
139
    setIdIsSet(false);
-
 
140
    this.id = 0;
137
    return new Tracker(this);
141
    setAffiliateIdIsSet(false);
-
 
142
    this.affiliateId = 0;
138
  }
143
  }
139
 
144
 
140
  public long getId() {
145
  public long getId() {
141
    return this.id;
146
    return this.id;
142
  }
147
  }
143
 
148
 
144
  public Tracker setId(long id) {
149
  public void setId(long id) {
145
    this.id = id;
150
    this.id = id;
146
    setIdIsSet(true);
151
    setIdIsSet(true);
147
    return this;
-
 
148
  }
152
  }
149
 
153
 
150
  public void unsetId() {
154
  public void unsetId() {
151
    __isset_bit_vector.clear(__ID_ISSET_ID);
155
    __isset_bit_vector.clear(__ID_ISSET_ID);
152
  }
156
  }
153
 
157
 
154
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
158
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
155
  public boolean isSetId() {
159
  public boolean isSetId() {
156
    return __isset_bit_vector.get(__ID_ISSET_ID);
160
    return __isset_bit_vector.get(__ID_ISSET_ID);
157
  }
161
  }
158
 
162
 
159
  public void setIdIsSet(boolean value) {
163
  public void setIdIsSet(boolean value) {
Line 162... Line 166...
162
 
166
 
163
  public long getAffiliateId() {
167
  public long getAffiliateId() {
164
    return this.affiliateId;
168
    return this.affiliateId;
165
  }
169
  }
166
 
170
 
167
  public Tracker setAffiliateId(long affiliateId) {
171
  public void setAffiliateId(long affiliateId) {
168
    this.affiliateId = affiliateId;
172
    this.affiliateId = affiliateId;
169
    setAffiliateIdIsSet(true);
173
    setAffiliateIdIsSet(true);
170
    return this;
-
 
171
  }
174
  }
172
 
175
 
173
  public void unsetAffiliateId() {
176
  public void unsetAffiliateId() {
174
    __isset_bit_vector.clear(__AFFILIATEID_ISSET_ID);
177
    __isset_bit_vector.clear(__AFFILIATEID_ISSET_ID);
175
  }
178
  }
176
 
179
 
177
  /** Returns true if field affiliateId is set (has been asigned a value) and false otherwise */
180
  /** Returns true if field affiliateId is set (has been assigned a value) and false otherwise */
178
  public boolean isSetAffiliateId() {
181
  public boolean isSetAffiliateId() {
179
    return __isset_bit_vector.get(__AFFILIATEID_ISSET_ID);
182
    return __isset_bit_vector.get(__AFFILIATEID_ISSET_ID);
180
  }
183
  }
181
 
184
 
182
  public void setAffiliateIdIsSet(boolean value) {
185
  public void setAffiliateIdIsSet(boolean value) {
Line 202... Line 205...
202
      break;
205
      break;
203
 
206
 
204
    }
207
    }
205
  }
208
  }
206
 
209
 
207
  public void setFieldValue(int fieldID, Object value) {
-
 
208
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
209
  }
-
 
210
 
-
 
211
  public Object getFieldValue(_Fields field) {
210
  public Object getFieldValue(_Fields field) {
212
    switch (field) {
211
    switch (field) {
213
    case ID:
212
    case ID:
214
      return new Long(getId());
213
      return Long.valueOf(getId());
215
 
214
 
216
    case AFFILIATE_ID:
215
    case AFFILIATE_ID:
217
      return new Long(getAffiliateId());
216
      return Long.valueOf(getAffiliateId());
218
 
217
 
219
    }
218
    }
220
    throw new IllegalStateException();
219
    throw new IllegalStateException();
221
  }
220
  }
222
 
221
 
223
  public Object getFieldValue(int fieldId) {
-
 
224
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
225
  }
-
 
226
 
-
 
227
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
222
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
228
  public boolean isSet(_Fields field) {
223
  public boolean isSet(_Fields field) {
-
 
224
    if (field == null) {
-
 
225
      throw new IllegalArgumentException();
-
 
226
    }
-
 
227
 
229
    switch (field) {
228
    switch (field) {
230
    case ID:
229
    case ID:
231
      return isSetId();
230
      return isSetId();
232
    case AFFILIATE_ID:
231
    case AFFILIATE_ID:
233
      return isSetAffiliateId();
232
      return isSetAffiliateId();
234
    }
233
    }
235
    throw new IllegalStateException();
234
    throw new IllegalStateException();
236
  }
235
  }
237
 
236
 
238
  public boolean isSet(int fieldID) {
-
 
239
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
240
  }
-
 
241
 
-
 
242
  @Override
237
  @Override
243
  public boolean equals(Object that) {
238
  public boolean equals(Object that) {
244
    if (that == null)
239
    if (that == null)
245
      return false;
240
      return false;
246
    if (that instanceof Tracker)
241
    if (that instanceof Tracker)
Line 284... Line 279...
284
    }
279
    }
285
 
280
 
286
    int lastComparison = 0;
281
    int lastComparison = 0;
287
    Tracker typedOther = (Tracker)other;
282
    Tracker typedOther = (Tracker)other;
288
 
283
 
289
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
284
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
290
    if (lastComparison != 0) {
285
    if (lastComparison != 0) {
291
      return lastComparison;
286
      return lastComparison;
292
    }
287
    }
-
 
288
    if (isSetId()) {
293
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
289
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
294
    if (lastComparison != 0) {
290
      if (lastComparison != 0) {
295
      return lastComparison;
291
        return lastComparison;
-
 
292
      }
296
    }
293
    }
297
    lastComparison = Boolean.valueOf(isSetAffiliateId()).compareTo(isSetAffiliateId());
294
    lastComparison = Boolean.valueOf(isSetAffiliateId()).compareTo(typedOther.isSetAffiliateId());
298
    if (lastComparison != 0) {
295
    if (lastComparison != 0) {
299
      return lastComparison;
296
      return lastComparison;
300
    }
297
    }
-
 
298
    if (isSetAffiliateId()) {
301
    lastComparison = TBaseHelper.compareTo(affiliateId, typedOther.affiliateId);
299
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.affiliateId, typedOther.affiliateId);
302
    if (lastComparison != 0) {
300
      if (lastComparison != 0) {
303
      return lastComparison;
301
        return lastComparison;
-
 
302
      }
304
    }
303
    }
305
    return 0;
304
    return 0;
306
  }
305
  }
307
 
306
 
-
 
307
  public _Fields fieldForId(int fieldId) {
-
 
308
    return _Fields.findByThriftId(fieldId);
-
 
309
  }
-
 
310
 
308
  public void read(TProtocol iprot) throws TException {
311
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
309
    TField field;
312
    org.apache.thrift.protocol.TField field;
310
    iprot.readStructBegin();
313
    iprot.readStructBegin();
311
    while (true)
314
    while (true)
312
    {
315
    {
313
      field = iprot.readFieldBegin();
316
      field = iprot.readFieldBegin();
314
      if (field.type == TType.STOP) { 
317
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
315
        break;
318
        break;
316
      }
319
      }
317
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
318
      if (fieldId == null) {
-
 
319
        TProtocolUtil.skip(iprot, field.type);
-
 
320
      } else {
-
 
321
        switch (fieldId) {
320
      switch (field.id) {
322
          case ID:
321
        case 1: // ID
323
            if (field.type == TType.I64) {
322
          if (field.type == org.apache.thrift.protocol.TType.I64) {
324
              this.id = iprot.readI64();
323
            this.id = iprot.readI64();
325
              setIdIsSet(true);
324
            setIdIsSet(true);
326
            } else { 
325
          } else { 
327
              TProtocolUtil.skip(iprot, field.type);
326
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
328
            }
327
          }
329
            break;
328
          break;
330
          case AFFILIATE_ID:
329
        case 2: // AFFILIATE_ID
331
            if (field.type == TType.I64) {
330
          if (field.type == org.apache.thrift.protocol.TType.I64) {
332
              this.affiliateId = iprot.readI64();
331
            this.affiliateId = iprot.readI64();
333
              setAffiliateIdIsSet(true);
332
            setAffiliateIdIsSet(true);
334
            } else { 
333
          } else { 
335
              TProtocolUtil.skip(iprot, field.type);
334
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
336
            }
335
          }
337
            break;
336
          break;
338
        }
337
        default:
339
        iprot.readFieldEnd();
338
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
340
      }
339
      }
-
 
340
      iprot.readFieldEnd();
341
    }
341
    }
342
    iprot.readStructEnd();
342
    iprot.readStructEnd();
343
    validate();
343
    validate();
344
  }
344
  }
345
 
345
 
346
  public void write(TProtocol oprot) throws TException {
346
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
347
    validate();
347
    validate();
348
 
348
 
349
    oprot.writeStructBegin(STRUCT_DESC);
349
    oprot.writeStructBegin(STRUCT_DESC);
350
    oprot.writeFieldBegin(ID_FIELD_DESC);
350
    oprot.writeFieldBegin(ID_FIELD_DESC);
351
    oprot.writeI64(this.id);
351
    oprot.writeI64(this.id);
Line 371... Line 371...
371
    first = false;
371
    first = false;
372
    sb.append(")");
372
    sb.append(")");
373
    return sb.toString();
373
    return sb.toString();
374
  }
374
  }
375
 
375
 
376
  public void validate() throws TException {
376
  public void validate() throws org.apache.thrift.TException {
377
    // check for required fields
377
    // check for required fields
378
  }
378
  }
379
 
379
 
-
 
380
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
381
    try {
-
 
382
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
383
    } catch (org.apache.thrift.TException te) {
-
 
384
      throw new java.io.IOException(te);
-
 
385
    }
-
 
386
  }
-
 
387
 
-
 
388
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
389
    try {
-
 
390
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
391
      __isset_bit_vector = new BitSet(1);
-
 
392
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
393
    } catch (org.apache.thrift.TException te) {
-
 
394
      throw new java.io.IOException(te);
-
 
395
    }
-
 
396
  }
-
 
397
 
380
}
398
}
381
 
399