Subversion Repositories SmartDukaan

Rev

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 TrackLog implements TBase<TrackLog._Fields>, java.io.Serializable, Cloneable, Comparable<TrackLog> {
27
  private static final TStruct STRUCT_DESC = new TStruct("TrackLog");
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
1860 vikas 30
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)2);
1998 vikas 31
  private static final TField AFFILIATE_ID_FIELD_DESC = new TField("affiliateId", TType.I64, (short)3);
1860 vikas 32
  private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)4);
3378 vikas 33
  private static final TField EVENT_TYPE_FIELD_DESC = new TField("eventType", TType.I32, (short)5);
1860 vikas 34
  private static final TField URL_FIELD_DESC = new TField("url", TType.STRING, (short)6);
35
  private static final TField DATA_FIELD_DESC = new TField("data", TType.STRING, (short)7);
1847 vikas 36
 
37
  private long id;
1860 vikas 38
  private long addedOn;
1998 vikas 39
  private long affiliateId;
1847 vikas 40
  private long userId;
3378 vikas 41
  private TrackLogType eventType;
1847 vikas 42
  private String url;
43
  private String data;
44
 
45
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
46
  public enum _Fields implements TFieldIdEnum {
47
    ID((short)1, "id"),
1860 vikas 48
    ADDED_ON((short)2, "addedOn"),
1998 vikas 49
    AFFILIATE_ID((short)3, "affiliateId"),
1860 vikas 50
    USER_ID((short)4, "userId"),
3378 vikas 51
    /**
52
     * 
53
     * @see TrackLogType
54
     */
55
    EVENT_TYPE((short)5, "eventType"),
1860 vikas 56
    URL((short)6, "url"),
57
    DATA((short)7, "data");
1847 vikas 58
 
59
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
60
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
61
 
62
    static {
63
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
64
        byId.put((int)field._thriftId, field);
65
        byName.put(field.getFieldName(), field);
66
      }
67
    }
68
 
69
    /**
70
     * Find the _Fields constant that matches fieldId, or null if its not found.
71
     */
72
    public static _Fields findByThriftId(int fieldId) {
73
      return byId.get(fieldId);
74
    }
75
 
76
    /**
77
     * Find the _Fields constant that matches fieldId, throwing an exception
78
     * if it is not found.
79
     */
80
    public static _Fields findByThriftIdOrThrow(int fieldId) {
81
      _Fields fields = findByThriftId(fieldId);
82
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
83
      return fields;
84
    }
85
 
86
    /**
87
     * Find the _Fields constant that matches name, or null if its not found.
88
     */
89
    public static _Fields findByName(String name) {
90
      return byName.get(name);
91
    }
92
 
93
    private final short _thriftId;
94
    private final String _fieldName;
95
 
96
    _Fields(short thriftId, String fieldName) {
97
      _thriftId = thriftId;
98
      _fieldName = fieldName;
99
    }
100
 
101
    public short getThriftFieldId() {
102
      return _thriftId;
103
    }
104
 
105
    public String getFieldName() {
106
      return _fieldName;
107
    }
108
  }
109
 
110
  // isset id assignments
111
  private static final int __ID_ISSET_ID = 0;
1860 vikas 112
  private static final int __ADDEDON_ISSET_ID = 1;
1998 vikas 113
  private static final int __AFFILIATEID_ISSET_ID = 2;
1860 vikas 114
  private static final int __USERID_ISSET_ID = 3;
115
  private BitSet __isset_bit_vector = new BitSet(4);
1847 vikas 116
 
117
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
118
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
119
        new FieldValueMetaData(TType.I64)));
1860 vikas 120
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
121
        new FieldValueMetaData(TType.I64)));
1998 vikas 122
    put(_Fields.AFFILIATE_ID, new FieldMetaData("affiliateId", TFieldRequirementType.DEFAULT, 
1847 vikas 123
        new FieldValueMetaData(TType.I64)));
124
    put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
125
        new FieldValueMetaData(TType.I64)));
3378 vikas 126
    put(_Fields.EVENT_TYPE, new FieldMetaData("eventType", TFieldRequirementType.DEFAULT, 
127
        new EnumMetaData(TType.ENUM, TrackLogType.class)));
1847 vikas 128
    put(_Fields.URL, new FieldMetaData("url", TFieldRequirementType.DEFAULT, 
129
        new FieldValueMetaData(TType.STRING)));
130
    put(_Fields.DATA, new FieldMetaData("data", TFieldRequirementType.DEFAULT, 
131
        new FieldValueMetaData(TType.STRING)));
132
  }});
133
 
134
  static {
135
    FieldMetaData.addStructMetaDataMap(TrackLog.class, metaDataMap);
136
  }
137
 
138
  public TrackLog() {
139
  }
140
 
141
  public TrackLog(
142
    long id,
1860 vikas 143
    long addedOn,
1998 vikas 144
    long affiliateId,
1847 vikas 145
    long userId,
3378 vikas 146
    TrackLogType eventType,
1847 vikas 147
    String url,
148
    String data)
149
  {
150
    this();
151
    this.id = id;
152
    setIdIsSet(true);
1860 vikas 153
    this.addedOn = addedOn;
154
    setAddedOnIsSet(true);
1998 vikas 155
    this.affiliateId = affiliateId;
156
    setAffiliateIdIsSet(true);
1847 vikas 157
    this.userId = userId;
158
    setUserIdIsSet(true);
3378 vikas 159
    this.eventType = eventType;
1847 vikas 160
    this.url = url;
161
    this.data = data;
162
  }
163
 
164
  /**
165
   * Performs a deep copy on <i>other</i>.
166
   */
167
  public TrackLog(TrackLog other) {
168
    __isset_bit_vector.clear();
169
    __isset_bit_vector.or(other.__isset_bit_vector);
170
    this.id = other.id;
1860 vikas 171
    this.addedOn = other.addedOn;
1998 vikas 172
    this.affiliateId = other.affiliateId;
1847 vikas 173
    this.userId = other.userId;
3378 vikas 174
    if (other.isSetEventType()) {
175
      this.eventType = other.eventType;
1847 vikas 176
    }
177
    if (other.isSetUrl()) {
178
      this.url = other.url;
179
    }
180
    if (other.isSetData()) {
181
      this.data = other.data;
182
    }
183
  }
184
 
185
  public TrackLog deepCopy() {
186
    return new TrackLog(this);
187
  }
188
 
189
  @Deprecated
190
  public TrackLog clone() {
191
    return new TrackLog(this);
192
  }
193
 
194
  public long getId() {
195
    return this.id;
196
  }
197
 
198
  public TrackLog setId(long id) {
199
    this.id = id;
200
    setIdIsSet(true);
201
    return this;
202
  }
203
 
204
  public void unsetId() {
205
    __isset_bit_vector.clear(__ID_ISSET_ID);
206
  }
207
 
208
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
209
  public boolean isSetId() {
210
    return __isset_bit_vector.get(__ID_ISSET_ID);
211
  }
212
 
213
  public void setIdIsSet(boolean value) {
214
    __isset_bit_vector.set(__ID_ISSET_ID, value);
215
  }
216
 
1860 vikas 217
  public long getAddedOn() {
218
    return this.addedOn;
219
  }
220
 
221
  public TrackLog setAddedOn(long addedOn) {
222
    this.addedOn = addedOn;
223
    setAddedOnIsSet(true);
224
    return this;
225
  }
226
 
227
  public void unsetAddedOn() {
228
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
229
  }
230
 
231
  /** Returns true if field addedOn is set (has been asigned a value) and false otherwise */
232
  public boolean isSetAddedOn() {
233
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
234
  }
235
 
236
  public void setAddedOnIsSet(boolean value) {
237
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
238
  }
239
 
1998 vikas 240
  public long getAffiliateId() {
241
    return this.affiliateId;
1847 vikas 242
  }
243
 
1998 vikas 244
  public TrackLog setAffiliateId(long affiliateId) {
245
    this.affiliateId = affiliateId;
246
    setAffiliateIdIsSet(true);
1847 vikas 247
    return this;
248
  }
249
 
1998 vikas 250
  public void unsetAffiliateId() {
251
    __isset_bit_vector.clear(__AFFILIATEID_ISSET_ID);
1847 vikas 252
  }
253
 
1998 vikas 254
  /** Returns true if field affiliateId is set (has been asigned a value) and false otherwise */
255
  public boolean isSetAffiliateId() {
256
    return __isset_bit_vector.get(__AFFILIATEID_ISSET_ID);
1847 vikas 257
  }
258
 
1998 vikas 259
  public void setAffiliateIdIsSet(boolean value) {
260
    __isset_bit_vector.set(__AFFILIATEID_ISSET_ID, value);
1847 vikas 261
  }
262
 
263
  public long getUserId() {
264
    return this.userId;
265
  }
266
 
267
  public TrackLog setUserId(long userId) {
268
    this.userId = userId;
269
    setUserIdIsSet(true);
270
    return this;
271
  }
272
 
273
  public void unsetUserId() {
274
    __isset_bit_vector.clear(__USERID_ISSET_ID);
275
  }
276
 
277
  /** Returns true if field userId is set (has been asigned a value) and false otherwise */
278
  public boolean isSetUserId() {
279
    return __isset_bit_vector.get(__USERID_ISSET_ID);
280
  }
281
 
282
  public void setUserIdIsSet(boolean value) {
283
    __isset_bit_vector.set(__USERID_ISSET_ID, value);
284
  }
285
 
3378 vikas 286
  /**
287
   * 
288
   * @see TrackLogType
289
   */
290
  public TrackLogType getEventType() {
291
    return this.eventType;
1847 vikas 292
  }
293
 
3378 vikas 294
  /**
295
   * 
296
   * @see TrackLogType
297
   */
298
  public TrackLog setEventType(TrackLogType eventType) {
299
    this.eventType = eventType;
1847 vikas 300
    return this;
301
  }
302
 
3378 vikas 303
  public void unsetEventType() {
304
    this.eventType = null;
1847 vikas 305
  }
306
 
3378 vikas 307
  /** Returns true if field eventType is set (has been asigned a value) and false otherwise */
308
  public boolean isSetEventType() {
309
    return this.eventType != null;
1847 vikas 310
  }
311
 
3378 vikas 312
  public void setEventTypeIsSet(boolean value) {
1847 vikas 313
    if (!value) {
3378 vikas 314
      this.eventType = null;
1847 vikas 315
    }
316
  }
317
 
318
  public String getUrl() {
319
    return this.url;
320
  }
321
 
322
  public TrackLog setUrl(String url) {
323
    this.url = url;
324
    return this;
325
  }
326
 
327
  public void unsetUrl() {
328
    this.url = null;
329
  }
330
 
331
  /** Returns true if field url is set (has been asigned a value) and false otherwise */
332
  public boolean isSetUrl() {
333
    return this.url != null;
334
  }
335
 
336
  public void setUrlIsSet(boolean value) {
337
    if (!value) {
338
      this.url = null;
339
    }
340
  }
341
 
342
  public String getData() {
343
    return this.data;
344
  }
345
 
346
  public TrackLog setData(String data) {
347
    this.data = data;
348
    return this;
349
  }
350
 
351
  public void unsetData() {
352
    this.data = null;
353
  }
354
 
355
  /** Returns true if field data is set (has been asigned a value) and false otherwise */
356
  public boolean isSetData() {
357
    return this.data != null;
358
  }
359
 
360
  public void setDataIsSet(boolean value) {
361
    if (!value) {
362
      this.data = null;
363
    }
364
  }
365
 
366
  public void setFieldValue(_Fields field, Object value) {
367
    switch (field) {
368
    case ID:
369
      if (value == null) {
370
        unsetId();
371
      } else {
372
        setId((Long)value);
373
      }
374
      break;
375
 
1860 vikas 376
    case ADDED_ON:
377
      if (value == null) {
378
        unsetAddedOn();
379
      } else {
380
        setAddedOn((Long)value);
381
      }
382
      break;
383
 
1998 vikas 384
    case AFFILIATE_ID:
1847 vikas 385
      if (value == null) {
1998 vikas 386
        unsetAffiliateId();
1847 vikas 387
      } else {
1998 vikas 388
        setAffiliateId((Long)value);
1847 vikas 389
      }
390
      break;
391
 
392
    case USER_ID:
393
      if (value == null) {
394
        unsetUserId();
395
      } else {
396
        setUserId((Long)value);
397
      }
398
      break;
399
 
3378 vikas 400
    case EVENT_TYPE:
1847 vikas 401
      if (value == null) {
3378 vikas 402
        unsetEventType();
1847 vikas 403
      } else {
3378 vikas 404
        setEventType((TrackLogType)value);
1847 vikas 405
      }
406
      break;
407
 
408
    case URL:
409
      if (value == null) {
410
        unsetUrl();
411
      } else {
412
        setUrl((String)value);
413
      }
414
      break;
415
 
416
    case DATA:
417
      if (value == null) {
418
        unsetData();
419
      } else {
420
        setData((String)value);
421
      }
422
      break;
423
 
424
    }
425
  }
426
 
427
  public void setFieldValue(int fieldID, Object value) {
428
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
429
  }
430
 
431
  public Object getFieldValue(_Fields field) {
432
    switch (field) {
433
    case ID:
434
      return new Long(getId());
435
 
1860 vikas 436
    case ADDED_ON:
437
      return new Long(getAddedOn());
438
 
1998 vikas 439
    case AFFILIATE_ID:
440
      return new Long(getAffiliateId());
1847 vikas 441
 
442
    case USER_ID:
443
      return new Long(getUserId());
444
 
3378 vikas 445
    case EVENT_TYPE:
446
      return getEventType();
1847 vikas 447
 
448
    case URL:
449
      return getUrl();
450
 
451
    case DATA:
452
      return getData();
453
 
454
    }
455
    throw new IllegalStateException();
456
  }
457
 
458
  public Object getFieldValue(int fieldId) {
459
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
460
  }
461
 
462
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
463
  public boolean isSet(_Fields field) {
464
    switch (field) {
465
    case ID:
466
      return isSetId();
1860 vikas 467
    case ADDED_ON:
468
      return isSetAddedOn();
1998 vikas 469
    case AFFILIATE_ID:
470
      return isSetAffiliateId();
1847 vikas 471
    case USER_ID:
472
      return isSetUserId();
3378 vikas 473
    case EVENT_TYPE:
474
      return isSetEventType();
1847 vikas 475
    case URL:
476
      return isSetUrl();
477
    case DATA:
478
      return isSetData();
479
    }
480
    throw new IllegalStateException();
481
  }
482
 
483
  public boolean isSet(int fieldID) {
484
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
485
  }
486
 
487
  @Override
488
  public boolean equals(Object that) {
489
    if (that == null)
490
      return false;
491
    if (that instanceof TrackLog)
492
      return this.equals((TrackLog)that);
493
    return false;
494
  }
495
 
496
  public boolean equals(TrackLog that) {
497
    if (that == null)
498
      return false;
499
 
500
    boolean this_present_id = true;
501
    boolean that_present_id = true;
502
    if (this_present_id || that_present_id) {
503
      if (!(this_present_id && that_present_id))
504
        return false;
505
      if (this.id != that.id)
506
        return false;
507
    }
508
 
1860 vikas 509
    boolean this_present_addedOn = true;
510
    boolean that_present_addedOn = true;
511
    if (this_present_addedOn || that_present_addedOn) {
512
      if (!(this_present_addedOn && that_present_addedOn))
513
        return false;
514
      if (this.addedOn != that.addedOn)
515
        return false;
516
    }
517
 
1998 vikas 518
    boolean this_present_affiliateId = true;
519
    boolean that_present_affiliateId = true;
520
    if (this_present_affiliateId || that_present_affiliateId) {
521
      if (!(this_present_affiliateId && that_present_affiliateId))
1847 vikas 522
        return false;
1998 vikas 523
      if (this.affiliateId != that.affiliateId)
1847 vikas 524
        return false;
525
    }
526
 
527
    boolean this_present_userId = true;
528
    boolean that_present_userId = true;
529
    if (this_present_userId || that_present_userId) {
530
      if (!(this_present_userId && that_present_userId))
531
        return false;
532
      if (this.userId != that.userId)
533
        return false;
534
    }
535
 
3378 vikas 536
    boolean this_present_eventType = true && this.isSetEventType();
537
    boolean that_present_eventType = true && that.isSetEventType();
538
    if (this_present_eventType || that_present_eventType) {
539
      if (!(this_present_eventType && that_present_eventType))
1847 vikas 540
        return false;
3378 vikas 541
      if (!this.eventType.equals(that.eventType))
1847 vikas 542
        return false;
543
    }
544
 
545
    boolean this_present_url = true && this.isSetUrl();
546
    boolean that_present_url = true && that.isSetUrl();
547
    if (this_present_url || that_present_url) {
548
      if (!(this_present_url && that_present_url))
549
        return false;
550
      if (!this.url.equals(that.url))
551
        return false;
552
    }
553
 
554
    boolean this_present_data = true && this.isSetData();
555
    boolean that_present_data = true && that.isSetData();
556
    if (this_present_data || that_present_data) {
557
      if (!(this_present_data && that_present_data))
558
        return false;
559
      if (!this.data.equals(that.data))
560
        return false;
561
    }
562
 
563
    return true;
564
  }
565
 
566
  @Override
567
  public int hashCode() {
568
    return 0;
569
  }
570
 
571
  public int compareTo(TrackLog other) {
572
    if (!getClass().equals(other.getClass())) {
573
      return getClass().getName().compareTo(other.getClass().getName());
574
    }
575
 
576
    int lastComparison = 0;
577
    TrackLog typedOther = (TrackLog)other;
578
 
579
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
580
    if (lastComparison != 0) {
581
      return lastComparison;
582
    }
583
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
584
    if (lastComparison != 0) {
585
      return lastComparison;
586
    }
1860 vikas 587
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(isSetAddedOn());
588
    if (lastComparison != 0) {
589
      return lastComparison;
590
    }
591
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
592
    if (lastComparison != 0) {
593
      return lastComparison;
594
    }
1998 vikas 595
    lastComparison = Boolean.valueOf(isSetAffiliateId()).compareTo(isSetAffiliateId());
1847 vikas 596
    if (lastComparison != 0) {
597
      return lastComparison;
598
    }
1998 vikas 599
    lastComparison = TBaseHelper.compareTo(affiliateId, typedOther.affiliateId);
1847 vikas 600
    if (lastComparison != 0) {
601
      return lastComparison;
602
    }
603
    lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
604
    if (lastComparison != 0) {
605
      return lastComparison;
606
    }
607
    lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
608
    if (lastComparison != 0) {
609
      return lastComparison;
610
    }
3378 vikas 611
    lastComparison = Boolean.valueOf(isSetEventType()).compareTo(isSetEventType());
1847 vikas 612
    if (lastComparison != 0) {
613
      return lastComparison;
614
    }
3378 vikas 615
    lastComparison = TBaseHelper.compareTo(eventType, typedOther.eventType);
1847 vikas 616
    if (lastComparison != 0) {
617
      return lastComparison;
618
    }
619
    lastComparison = Boolean.valueOf(isSetUrl()).compareTo(isSetUrl());
620
    if (lastComparison != 0) {
621
      return lastComparison;
622
    }
623
    lastComparison = TBaseHelper.compareTo(url, typedOther.url);
624
    if (lastComparison != 0) {
625
      return lastComparison;
626
    }
627
    lastComparison = Boolean.valueOf(isSetData()).compareTo(isSetData());
628
    if (lastComparison != 0) {
629
      return lastComparison;
630
    }
631
    lastComparison = TBaseHelper.compareTo(data, typedOther.data);
632
    if (lastComparison != 0) {
633
      return lastComparison;
634
    }
635
    return 0;
636
  }
637
 
638
  public void read(TProtocol iprot) throws TException {
639
    TField field;
640
    iprot.readStructBegin();
641
    while (true)
642
    {
643
      field = iprot.readFieldBegin();
644
      if (field.type == TType.STOP) { 
645
        break;
646
      }
647
      _Fields fieldId = _Fields.findByThriftId(field.id);
648
      if (fieldId == null) {
649
        TProtocolUtil.skip(iprot, field.type);
650
      } else {
651
        switch (fieldId) {
652
          case ID:
653
            if (field.type == TType.I64) {
654
              this.id = iprot.readI64();
655
              setIdIsSet(true);
656
            } else { 
657
              TProtocolUtil.skip(iprot, field.type);
658
            }
659
            break;
1860 vikas 660
          case ADDED_ON:
661
            if (field.type == TType.I64) {
662
              this.addedOn = iprot.readI64();
663
              setAddedOnIsSet(true);
664
            } else { 
665
              TProtocolUtil.skip(iprot, field.type);
666
            }
667
            break;
1998 vikas 668
          case AFFILIATE_ID:
1847 vikas 669
            if (field.type == TType.I64) {
1998 vikas 670
              this.affiliateId = iprot.readI64();
671
              setAffiliateIdIsSet(true);
1847 vikas 672
            } else { 
673
              TProtocolUtil.skip(iprot, field.type);
674
            }
675
            break;
676
          case USER_ID:
677
            if (field.type == TType.I64) {
678
              this.userId = iprot.readI64();
679
              setUserIdIsSet(true);
680
            } else { 
681
              TProtocolUtil.skip(iprot, field.type);
682
            }
683
            break;
3378 vikas 684
          case EVENT_TYPE:
685
            if (field.type == TType.I32) {
686
              this.eventType = TrackLogType.findByValue(iprot.readI32());
1847 vikas 687
            } else { 
688
              TProtocolUtil.skip(iprot, field.type);
689
            }
690
            break;
691
          case URL:
692
            if (field.type == TType.STRING) {
693
              this.url = iprot.readString();
694
            } else { 
695
              TProtocolUtil.skip(iprot, field.type);
696
            }
697
            break;
698
          case DATA:
699
            if (field.type == TType.STRING) {
700
              this.data = iprot.readString();
701
            } else { 
702
              TProtocolUtil.skip(iprot, field.type);
703
            }
704
            break;
705
        }
706
        iprot.readFieldEnd();
707
      }
708
    }
709
    iprot.readStructEnd();
710
    validate();
711
  }
712
 
713
  public void write(TProtocol oprot) throws TException {
714
    validate();
715
 
716
    oprot.writeStructBegin(STRUCT_DESC);
717
    oprot.writeFieldBegin(ID_FIELD_DESC);
718
    oprot.writeI64(this.id);
719
    oprot.writeFieldEnd();
1860 vikas 720
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
721
    oprot.writeI64(this.addedOn);
722
    oprot.writeFieldEnd();
1998 vikas 723
    oprot.writeFieldBegin(AFFILIATE_ID_FIELD_DESC);
724
    oprot.writeI64(this.affiliateId);
1847 vikas 725
    oprot.writeFieldEnd();
726
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
727
    oprot.writeI64(this.userId);
728
    oprot.writeFieldEnd();
3378 vikas 729
    if (this.eventType != null) {
730
      oprot.writeFieldBegin(EVENT_TYPE_FIELD_DESC);
731
      oprot.writeI32(this.eventType.getValue());
1847 vikas 732
      oprot.writeFieldEnd();
733
    }
734
    if (this.url != null) {
735
      oprot.writeFieldBegin(URL_FIELD_DESC);
736
      oprot.writeString(this.url);
737
      oprot.writeFieldEnd();
738
    }
739
    if (this.data != null) {
740
      oprot.writeFieldBegin(DATA_FIELD_DESC);
741
      oprot.writeString(this.data);
742
      oprot.writeFieldEnd();
743
    }
744
    oprot.writeFieldStop();
745
    oprot.writeStructEnd();
746
  }
747
 
748
  @Override
749
  public String toString() {
750
    StringBuilder sb = new StringBuilder("TrackLog(");
751
    boolean first = true;
752
 
753
    sb.append("id:");
754
    sb.append(this.id);
755
    first = false;
756
    if (!first) sb.append(", ");
1860 vikas 757
    sb.append("addedOn:");
758
    sb.append(this.addedOn);
759
    first = false;
760
    if (!first) sb.append(", ");
1998 vikas 761
    sb.append("affiliateId:");
762
    sb.append(this.affiliateId);
1847 vikas 763
    first = false;
764
    if (!first) sb.append(", ");
765
    sb.append("userId:");
766
    sb.append(this.userId);
767
    first = false;
768
    if (!first) sb.append(", ");
3378 vikas 769
    sb.append("eventType:");
770
    if (this.eventType == null) {
1847 vikas 771
      sb.append("null");
772
    } else {
3378 vikas 773
      String eventType_name = eventType.name();
774
      if (eventType_name != null) {
775
        sb.append(eventType_name);
776
        sb.append(" (");
777
      }
778
      sb.append(this.eventType);
779
      if (eventType_name != null) {
780
        sb.append(")");
781
      }
1847 vikas 782
    }
783
    first = false;
784
    if (!first) sb.append(", ");
785
    sb.append("url:");
786
    if (this.url == null) {
787
      sb.append("null");
788
    } else {
789
      sb.append(this.url);
790
    }
791
    first = false;
792
    if (!first) sb.append(", ");
793
    sb.append("data:");
794
    if (this.data == null) {
795
      sb.append("null");
796
    } else {
797
      sb.append(this.data);
798
    }
799
    first = false;
800
    sb.append(")");
801
    return sb.toString();
802
  }
803
 
804
  public void validate() throws TException {
805
    // check for required fields
806
  }
807
 
808
}
809