Subversion Repositories SmartDukaan

Rev

Rev 1847 | Rev 1998 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1847 vikas 1
/**
2
 * Autogenerated by Thrift
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;
18
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class Tracker implements TBase<Tracker._Fields>, java.io.Serializable, Cloneable, Comparable<Tracker> {
27
  private static final TStruct STRUCT_DESC = new TStruct("Tracker");
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);
1860 vikas 31
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)3);
1847 vikas 32
 
33
  private long id;
34
  private long affiliateId;
1860 vikas 35
  private long addedOn;
1847 vikas 36
 
37
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
38
  public enum _Fields implements TFieldIdEnum {
39
    ID((short)1, "id"),
1860 vikas 40
    AFFILIATE_ID((short)2, "affiliateId"),
41
    ADDED_ON((short)3, "addedOn");
1847 vikas 42
 
43
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
45
 
46
    static {
47
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
48
        byId.put((int)field._thriftId, field);
49
        byName.put(field.getFieldName(), field);
50
      }
51
    }
52
 
53
    /**
54
     * Find the _Fields constant that matches fieldId, or null if its not found.
55
     */
56
    public static _Fields findByThriftId(int fieldId) {
57
      return byId.get(fieldId);
58
    }
59
 
60
    /**
61
     * Find the _Fields constant that matches fieldId, throwing an exception
62
     * if it is not found.
63
     */
64
    public static _Fields findByThriftIdOrThrow(int fieldId) {
65
      _Fields fields = findByThriftId(fieldId);
66
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
67
      return fields;
68
    }
69
 
70
    /**
71
     * Find the _Fields constant that matches name, or null if its not found.
72
     */
73
    public static _Fields findByName(String name) {
74
      return byName.get(name);
75
    }
76
 
77
    private final short _thriftId;
78
    private final String _fieldName;
79
 
80
    _Fields(short thriftId, String fieldName) {
81
      _thriftId = thriftId;
82
      _fieldName = fieldName;
83
    }
84
 
85
    public short getThriftFieldId() {
86
      return _thriftId;
87
    }
88
 
89
    public String getFieldName() {
90
      return _fieldName;
91
    }
92
  }
93
 
94
  // isset id assignments
95
  private static final int __ID_ISSET_ID = 0;
96
  private static final int __AFFILIATEID_ISSET_ID = 1;
1860 vikas 97
  private static final int __ADDEDON_ISSET_ID = 2;
98
  private BitSet __isset_bit_vector = new BitSet(3);
1847 vikas 99
 
100
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
101
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
102
        new FieldValueMetaData(TType.I64)));
103
    put(_Fields.AFFILIATE_ID, new FieldMetaData("affiliateId", TFieldRequirementType.DEFAULT, 
104
        new FieldValueMetaData(TType.I64)));
1860 vikas 105
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
106
        new FieldValueMetaData(TType.I64)));
1847 vikas 107
  }});
108
 
109
  static {
110
    FieldMetaData.addStructMetaDataMap(Tracker.class, metaDataMap);
111
  }
112
 
113
  public Tracker() {
114
  }
115
 
116
  public Tracker(
117
    long id,
1860 vikas 118
    long affiliateId,
119
    long addedOn)
1847 vikas 120
  {
121
    this();
122
    this.id = id;
123
    setIdIsSet(true);
124
    this.affiliateId = affiliateId;
125
    setAffiliateIdIsSet(true);
1860 vikas 126
    this.addedOn = addedOn;
127
    setAddedOnIsSet(true);
1847 vikas 128
  }
129
 
130
  /**
131
   * Performs a deep copy on <i>other</i>.
132
   */
133
  public Tracker(Tracker other) {
134
    __isset_bit_vector.clear();
135
    __isset_bit_vector.or(other.__isset_bit_vector);
136
    this.id = other.id;
137
    this.affiliateId = other.affiliateId;
1860 vikas 138
    this.addedOn = other.addedOn;
1847 vikas 139
  }
140
 
141
  public Tracker deepCopy() {
142
    return new Tracker(this);
143
  }
144
 
145
  @Deprecated
146
  public Tracker clone() {
147
    return new Tracker(this);
148
  }
149
 
150
  public long getId() {
151
    return this.id;
152
  }
153
 
154
  public Tracker setId(long id) {
155
    this.id = id;
156
    setIdIsSet(true);
157
    return this;
158
  }
159
 
160
  public void unsetId() {
161
    __isset_bit_vector.clear(__ID_ISSET_ID);
162
  }
163
 
164
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
165
  public boolean isSetId() {
166
    return __isset_bit_vector.get(__ID_ISSET_ID);
167
  }
168
 
169
  public void setIdIsSet(boolean value) {
170
    __isset_bit_vector.set(__ID_ISSET_ID, value);
171
  }
172
 
173
  public long getAffiliateId() {
174
    return this.affiliateId;
175
  }
176
 
177
  public Tracker setAffiliateId(long affiliateId) {
178
    this.affiliateId = affiliateId;
179
    setAffiliateIdIsSet(true);
180
    return this;
181
  }
182
 
183
  public void unsetAffiliateId() {
184
    __isset_bit_vector.clear(__AFFILIATEID_ISSET_ID);
185
  }
186
 
187
  /** Returns true if field affiliateId is set (has been asigned a value) and false otherwise */
188
  public boolean isSetAffiliateId() {
189
    return __isset_bit_vector.get(__AFFILIATEID_ISSET_ID);
190
  }
191
 
192
  public void setAffiliateIdIsSet(boolean value) {
193
    __isset_bit_vector.set(__AFFILIATEID_ISSET_ID, value);
194
  }
195
 
1860 vikas 196
  public long getAddedOn() {
197
    return this.addedOn;
198
  }
199
 
200
  public Tracker setAddedOn(long addedOn) {
201
    this.addedOn = addedOn;
202
    setAddedOnIsSet(true);
203
    return this;
204
  }
205
 
206
  public void unsetAddedOn() {
207
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
208
  }
209
 
210
  /** Returns true if field addedOn is set (has been asigned a value) and false otherwise */
211
  public boolean isSetAddedOn() {
212
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
213
  }
214
 
215
  public void setAddedOnIsSet(boolean value) {
216
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
217
  }
218
 
1847 vikas 219
  public void setFieldValue(_Fields field, Object value) {
220
    switch (field) {
221
    case ID:
222
      if (value == null) {
223
        unsetId();
224
      } else {
225
        setId((Long)value);
226
      }
227
      break;
228
 
229
    case AFFILIATE_ID:
230
      if (value == null) {
231
        unsetAffiliateId();
232
      } else {
233
        setAffiliateId((Long)value);
234
      }
235
      break;
236
 
1860 vikas 237
    case ADDED_ON:
238
      if (value == null) {
239
        unsetAddedOn();
240
      } else {
241
        setAddedOn((Long)value);
242
      }
243
      break;
244
 
1847 vikas 245
    }
246
  }
247
 
248
  public void setFieldValue(int fieldID, Object value) {
249
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
250
  }
251
 
252
  public Object getFieldValue(_Fields field) {
253
    switch (field) {
254
    case ID:
255
      return new Long(getId());
256
 
257
    case AFFILIATE_ID:
258
      return new Long(getAffiliateId());
259
 
1860 vikas 260
    case ADDED_ON:
261
      return new Long(getAddedOn());
262
 
1847 vikas 263
    }
264
    throw new IllegalStateException();
265
  }
266
 
267
  public Object getFieldValue(int fieldId) {
268
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
269
  }
270
 
271
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
272
  public boolean isSet(_Fields field) {
273
    switch (field) {
274
    case ID:
275
      return isSetId();
276
    case AFFILIATE_ID:
277
      return isSetAffiliateId();
1860 vikas 278
    case ADDED_ON:
279
      return isSetAddedOn();
1847 vikas 280
    }
281
    throw new IllegalStateException();
282
  }
283
 
284
  public boolean isSet(int fieldID) {
285
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
286
  }
287
 
288
  @Override
289
  public boolean equals(Object that) {
290
    if (that == null)
291
      return false;
292
    if (that instanceof Tracker)
293
      return this.equals((Tracker)that);
294
    return false;
295
  }
296
 
297
  public boolean equals(Tracker that) {
298
    if (that == null)
299
      return false;
300
 
301
    boolean this_present_id = true;
302
    boolean that_present_id = true;
303
    if (this_present_id || that_present_id) {
304
      if (!(this_present_id && that_present_id))
305
        return false;
306
      if (this.id != that.id)
307
        return false;
308
    }
309
 
310
    boolean this_present_affiliateId = true;
311
    boolean that_present_affiliateId = true;
312
    if (this_present_affiliateId || that_present_affiliateId) {
313
      if (!(this_present_affiliateId && that_present_affiliateId))
314
        return false;
315
      if (this.affiliateId != that.affiliateId)
316
        return false;
317
    }
318
 
1860 vikas 319
    boolean this_present_addedOn = true;
320
    boolean that_present_addedOn = true;
321
    if (this_present_addedOn || that_present_addedOn) {
322
      if (!(this_present_addedOn && that_present_addedOn))
323
        return false;
324
      if (this.addedOn != that.addedOn)
325
        return false;
326
    }
327
 
1847 vikas 328
    return true;
329
  }
330
 
331
  @Override
332
  public int hashCode() {
333
    return 0;
334
  }
335
 
336
  public int compareTo(Tracker other) {
337
    if (!getClass().equals(other.getClass())) {
338
      return getClass().getName().compareTo(other.getClass().getName());
339
    }
340
 
341
    int lastComparison = 0;
342
    Tracker typedOther = (Tracker)other;
343
 
344
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
345
    if (lastComparison != 0) {
346
      return lastComparison;
347
    }
348
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
349
    if (lastComparison != 0) {
350
      return lastComparison;
351
    }
352
    lastComparison = Boolean.valueOf(isSetAffiliateId()).compareTo(isSetAffiliateId());
353
    if (lastComparison != 0) {
354
      return lastComparison;
355
    }
356
    lastComparison = TBaseHelper.compareTo(affiliateId, typedOther.affiliateId);
357
    if (lastComparison != 0) {
358
      return lastComparison;
359
    }
1860 vikas 360
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(isSetAddedOn());
361
    if (lastComparison != 0) {
362
      return lastComparison;
363
    }
364
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
365
    if (lastComparison != 0) {
366
      return lastComparison;
367
    }
1847 vikas 368
    return 0;
369
  }
370
 
371
  public void read(TProtocol iprot) throws TException {
372
    TField field;
373
    iprot.readStructBegin();
374
    while (true)
375
    {
376
      field = iprot.readFieldBegin();
377
      if (field.type == TType.STOP) { 
378
        break;
379
      }
380
      _Fields fieldId = _Fields.findByThriftId(field.id);
381
      if (fieldId == null) {
382
        TProtocolUtil.skip(iprot, field.type);
383
      } else {
384
        switch (fieldId) {
385
          case ID:
386
            if (field.type == TType.I64) {
387
              this.id = iprot.readI64();
388
              setIdIsSet(true);
389
            } else { 
390
              TProtocolUtil.skip(iprot, field.type);
391
            }
392
            break;
393
          case AFFILIATE_ID:
394
            if (field.type == TType.I64) {
395
              this.affiliateId = iprot.readI64();
396
              setAffiliateIdIsSet(true);
397
            } else { 
398
              TProtocolUtil.skip(iprot, field.type);
399
            }
400
            break;
1860 vikas 401
          case ADDED_ON:
402
            if (field.type == TType.I64) {
403
              this.addedOn = iprot.readI64();
404
              setAddedOnIsSet(true);
405
            } else { 
406
              TProtocolUtil.skip(iprot, field.type);
407
            }
408
            break;
1847 vikas 409
        }
410
        iprot.readFieldEnd();
411
      }
412
    }
413
    iprot.readStructEnd();
414
    validate();
415
  }
416
 
417
  public void write(TProtocol oprot) throws TException {
418
    validate();
419
 
420
    oprot.writeStructBegin(STRUCT_DESC);
421
    oprot.writeFieldBegin(ID_FIELD_DESC);
422
    oprot.writeI64(this.id);
423
    oprot.writeFieldEnd();
424
    oprot.writeFieldBegin(AFFILIATE_ID_FIELD_DESC);
425
    oprot.writeI64(this.affiliateId);
426
    oprot.writeFieldEnd();
1860 vikas 427
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
428
    oprot.writeI64(this.addedOn);
429
    oprot.writeFieldEnd();
1847 vikas 430
    oprot.writeFieldStop();
431
    oprot.writeStructEnd();
432
  }
433
 
434
  @Override
435
  public String toString() {
436
    StringBuilder sb = new StringBuilder("Tracker(");
437
    boolean first = true;
438
 
439
    sb.append("id:");
440
    sb.append(this.id);
441
    first = false;
442
    if (!first) sb.append(", ");
443
    sb.append("affiliateId:");
444
    sb.append(this.affiliateId);
445
    first = false;
1860 vikas 446
    if (!first) sb.append(", ");
447
    sb.append("addedOn:");
448
    sb.append(this.addedOn);
449
    first = false;
1847 vikas 450
    sb.append(")");
451
    return sb.toString();
452
  }
453
 
454
  public void validate() throws TException {
455
    // check for required fields
456
  }
457
 
458
}
459