Subversion Repositories SmartDukaan

Rev

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