Subversion Repositories SmartDukaan

Rev

Rev 1998 | Details | Compare with Previous | Last modification | View Log | RSS feed

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