Subversion Repositories SmartDukaan

Rev

Rev 1847 | Rev 1998 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1847 Rev 1860
Line 26... Line 26...
26
public class Tracker implements TBase<Tracker._Fields>, java.io.Serializable, Cloneable, Comparable<Tracker> {
26
public class Tracker implements TBase<Tracker._Fields>, java.io.Serializable, Cloneable, Comparable<Tracker> {
27
  private static final TStruct STRUCT_DESC = new TStruct("Tracker");
27
  private static final TStruct STRUCT_DESC = new TStruct("Tracker");
28
 
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
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);
30
  private static final TField AFFILIATE_ID_FIELD_DESC = new TField("affiliateId", TType.I64, (short)2);
-
 
31
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)3);
31
 
32
 
32
  private long id;
33
  private long id;
33
  private long affiliateId;
34
  private long affiliateId;
-
 
35
  private long addedOn;
34
 
36
 
35
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
37
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  public enum _Fields implements TFieldIdEnum {
38
  public enum _Fields implements TFieldIdEnum {
37
    ID((short)1, "id"),
39
    ID((short)1, "id"),
38
    AFFILIATE_ID((short)2, "affiliateId");
40
    AFFILIATE_ID((short)2, "affiliateId"),
-
 
41
    ADDED_ON((short)3, "addedOn");
39
 
42
 
40
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
43
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
41
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
42
 
45
 
43
    static {
46
    static {
Line 89... Line 92...
89
  }
92
  }
90
 
93
 
91
  // isset id assignments
94
  // isset id assignments
92
  private static final int __ID_ISSET_ID = 0;
95
  private static final int __ID_ISSET_ID = 0;
93
  private static final int __AFFILIATEID_ISSET_ID = 1;
96
  private static final int __AFFILIATEID_ISSET_ID = 1;
-
 
97
  private static final int __ADDEDON_ISSET_ID = 2;
94
  private BitSet __isset_bit_vector = new BitSet(2);
98
  private BitSet __isset_bit_vector = new BitSet(3);
95
 
99
 
96
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
100
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
97
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
101
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
98
        new FieldValueMetaData(TType.I64)));
102
        new FieldValueMetaData(TType.I64)));
99
    put(_Fields.AFFILIATE_ID, new FieldMetaData("affiliateId", TFieldRequirementType.DEFAULT, 
103
    put(_Fields.AFFILIATE_ID, new FieldMetaData("affiliateId", TFieldRequirementType.DEFAULT, 
100
        new FieldValueMetaData(TType.I64)));
104
        new FieldValueMetaData(TType.I64)));
-
 
105
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
-
 
106
        new FieldValueMetaData(TType.I64)));
101
  }});
107
  }});
102
 
108
 
103
  static {
109
  static {
104
    FieldMetaData.addStructMetaDataMap(Tracker.class, metaDataMap);
110
    FieldMetaData.addStructMetaDataMap(Tracker.class, metaDataMap);
105
  }
111
  }
Line 107... Line 113...
107
  public Tracker() {
113
  public Tracker() {
108
  }
114
  }
109
 
115
 
110
  public Tracker(
116
  public Tracker(
111
    long id,
117
    long id,
112
    long affiliateId)
118
    long affiliateId,
-
 
119
    long addedOn)
113
  {
120
  {
114
    this();
121
    this();
115
    this.id = id;
122
    this.id = id;
116
    setIdIsSet(true);
123
    setIdIsSet(true);
117
    this.affiliateId = affiliateId;
124
    this.affiliateId = affiliateId;
118
    setAffiliateIdIsSet(true);
125
    setAffiliateIdIsSet(true);
-
 
126
    this.addedOn = addedOn;
-
 
127
    setAddedOnIsSet(true);
119
  }
128
  }
120
 
129
 
121
  /**
130
  /**
122
   * Performs a deep copy on <i>other</i>.
131
   * Performs a deep copy on <i>other</i>.
123
   */
132
   */
124
  public Tracker(Tracker other) {
133
  public Tracker(Tracker other) {
125
    __isset_bit_vector.clear();
134
    __isset_bit_vector.clear();
126
    __isset_bit_vector.or(other.__isset_bit_vector);
135
    __isset_bit_vector.or(other.__isset_bit_vector);
127
    this.id = other.id;
136
    this.id = other.id;
128
    this.affiliateId = other.affiliateId;
137
    this.affiliateId = other.affiliateId;
-
 
138
    this.addedOn = other.addedOn;
129
  }
139
  }
130
 
140
 
131
  public Tracker deepCopy() {
141
  public Tracker deepCopy() {
132
    return new Tracker(this);
142
    return new Tracker(this);
133
  }
143
  }
Line 181... Line 191...
181
 
191
 
182
  public void setAffiliateIdIsSet(boolean value) {
192
  public void setAffiliateIdIsSet(boolean value) {
183
    __isset_bit_vector.set(__AFFILIATEID_ISSET_ID, value);
193
    __isset_bit_vector.set(__AFFILIATEID_ISSET_ID, value);
184
  }
194
  }
185
 
195
 
-
 
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
 
186
  public void setFieldValue(_Fields field, Object value) {
219
  public void setFieldValue(_Fields field, Object value) {
187
    switch (field) {
220
    switch (field) {
188
    case ID:
221
    case ID:
189
      if (value == null) {
222
      if (value == null) {
190
        unsetId();
223
        unsetId();
Line 199... Line 232...
199
      } else {
232
      } else {
200
        setAffiliateId((Long)value);
233
        setAffiliateId((Long)value);
201
      }
234
      }
202
      break;
235
      break;
203
 
236
 
-
 
237
    case ADDED_ON:
-
 
238
      if (value == null) {
-
 
239
        unsetAddedOn();
-
 
240
      } else {
-
 
241
        setAddedOn((Long)value);
-
 
242
      }
-
 
243
      break;
-
 
244
 
204
    }
245
    }
205
  }
246
  }
206
 
247
 
207
  public void setFieldValue(int fieldID, Object value) {
248
  public void setFieldValue(int fieldID, Object value) {
208
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
249
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 214... Line 255...
214
      return new Long(getId());
255
      return new Long(getId());
215
 
256
 
216
    case AFFILIATE_ID:
257
    case AFFILIATE_ID:
217
      return new Long(getAffiliateId());
258
      return new Long(getAffiliateId());
218
 
259
 
-
 
260
    case ADDED_ON:
-
 
261
      return new Long(getAddedOn());
-
 
262
 
219
    }
263
    }
220
    throw new IllegalStateException();
264
    throw new IllegalStateException();
221
  }
265
  }
222
 
266
 
223
  public Object getFieldValue(int fieldId) {
267
  public Object getFieldValue(int fieldId) {
Line 229... Line 273...
229
    switch (field) {
273
    switch (field) {
230
    case ID:
274
    case ID:
231
      return isSetId();
275
      return isSetId();
232
    case AFFILIATE_ID:
276
    case AFFILIATE_ID:
233
      return isSetAffiliateId();
277
      return isSetAffiliateId();
-
 
278
    case ADDED_ON:
-
 
279
      return isSetAddedOn();
234
    }
280
    }
235
    throw new IllegalStateException();
281
    throw new IllegalStateException();
236
  }
282
  }
237
 
283
 
238
  public boolean isSet(int fieldID) {
284
  public boolean isSet(int fieldID) {
Line 268... Line 314...
268
        return false;
314
        return false;
269
      if (this.affiliateId != that.affiliateId)
315
      if (this.affiliateId != that.affiliateId)
270
        return false;
316
        return false;
271
    }
317
    }
272
 
318
 
-
 
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
 
273
    return true;
328
    return true;
274
  }
329
  }
275
 
330
 
276
  @Override
331
  @Override
277
  public int hashCode() {
332
  public int hashCode() {
Line 300... Line 355...
300
    }
355
    }
301
    lastComparison = TBaseHelper.compareTo(affiliateId, typedOther.affiliateId);
356
    lastComparison = TBaseHelper.compareTo(affiliateId, typedOther.affiliateId);
302
    if (lastComparison != 0) {
357
    if (lastComparison != 0) {
303
      return lastComparison;
358
      return lastComparison;
304
    }
359
    }
-
 
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
    }
305
    return 0;
368
    return 0;
306
  }
369
  }
307
 
370
 
308
  public void read(TProtocol iprot) throws TException {
371
  public void read(TProtocol iprot) throws TException {
309
    TField field;
372
    TField field;
Line 333... Line 396...
333
              setAffiliateIdIsSet(true);
396
              setAffiliateIdIsSet(true);
334
            } else { 
397
            } else { 
335
              TProtocolUtil.skip(iprot, field.type);
398
              TProtocolUtil.skip(iprot, field.type);
336
            }
399
            }
337
            break;
400
            break;
-
 
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;
338
        }
409
        }
339
        iprot.readFieldEnd();
410
        iprot.readFieldEnd();
340
      }
411
      }
341
    }
412
    }
342
    iprot.readStructEnd();
413
    iprot.readStructEnd();
Line 351... Line 422...
351
    oprot.writeI64(this.id);
422
    oprot.writeI64(this.id);
352
    oprot.writeFieldEnd();
423
    oprot.writeFieldEnd();
353
    oprot.writeFieldBegin(AFFILIATE_ID_FIELD_DESC);
424
    oprot.writeFieldBegin(AFFILIATE_ID_FIELD_DESC);
354
    oprot.writeI64(this.affiliateId);
425
    oprot.writeI64(this.affiliateId);
355
    oprot.writeFieldEnd();
426
    oprot.writeFieldEnd();
-
 
427
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
-
 
428
    oprot.writeI64(this.addedOn);
-
 
429
    oprot.writeFieldEnd();
356
    oprot.writeFieldStop();
430
    oprot.writeFieldStop();
357
    oprot.writeStructEnd();
431
    oprot.writeStructEnd();
358
  }
432
  }
359
 
433
 
360
  @Override
434
  @Override
Line 367... Line 441...
367
    first = false;
441
    first = false;
368
    if (!first) sb.append(", ");
442
    if (!first) sb.append(", ");
369
    sb.append("affiliateId:");
443
    sb.append("affiliateId:");
370
    sb.append(this.affiliateId);
444
    sb.append(this.affiliateId);
371
    first = false;
445
    first = false;
-
 
446
    if (!first) sb.append(", ");
-
 
447
    sb.append("addedOn:");
-
 
448
    sb.append(this.addedOn);
-
 
449
    first = false;
372
    sb.append(")");
450
    sb.append(")");
373
    return sb.toString();
451
    return sb.toString();
374
  }
452
  }
375
 
453
 
376
  public void validate() throws TException {
454
  public void validate() throws TException {