Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
48 ashish 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 TUserState implements TBase<TUserState._Fields>, java.io.Serializable, Cloneable {
27
  private static final TStruct STRUCT_DESC = new TStruct("TUserState");
28
 
29
  private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
30
  private static final TField IS_EMAIL_VERIFIED_FIELD_DESC = new TField("isEmailVerified", TType.BOOL, (short)2);
31
  private static final TField LAST_LOGIN_FIELD_DESC = new TField("lastLogin", TType.I64, (short)3);
32
  private static final TField LAST_LOGOUT_FIELD_DESC = new TField("lastLogout", TType.I64, (short)4);
33
  private static final TField EMAIL_VERIFICATION_SENT_ON_FIELD_DESC = new TField("emailVerificationSentOn", TType.I64, (short)5);
34
  private static final TField SMS_VERIFICATION_SENT_ON_FIELD_DESC = new TField("smsVerificationSentOn", TType.I64, (short)6);
35
  private static final TField IS_SMSVERIFIED_FIELD_DESC = new TField("isSMSVerified", TType.BOOL, (short)7);
36
  private static final TField ACTIVE_SINCE_FIELD_DESC = new TField("activeSince", TType.I64, (short)8);
37
  private static final TField IS_LOGGED_IN_FIELD_DESC = new TField("isLoggedIn", TType.BOOL, (short)9);
38
  private static final TField IP_MAP_FIELD_DESC = new TField("ipMap", TType.STRUCT, (short)10);
39
 
40
  private long userId;
41
  private boolean isEmailVerified;
42
  private long lastLogin;
43
  private long lastLogout;
44
  private long emailVerificationSentOn;
45
  private long smsVerificationSentOn;
46
  private boolean isSMSVerified;
47
  private long activeSince;
48
  private boolean isLoggedIn;
49
  private TIPMap ipMap;
50
 
51
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
52
  public enum _Fields implements TFieldIdEnum {
53
    USER_ID((short)1, "userId"),
54
    IS_EMAIL_VERIFIED((short)2, "isEmailVerified"),
55
    LAST_LOGIN((short)3, "lastLogin"),
56
    LAST_LOGOUT((short)4, "lastLogout"),
57
    EMAIL_VERIFICATION_SENT_ON((short)5, "emailVerificationSentOn"),
58
    SMS_VERIFICATION_SENT_ON((short)6, "smsVerificationSentOn"),
59
    IS_SMSVERIFIED((short)7, "isSMSVerified"),
60
    ACTIVE_SINCE((short)8, "activeSince"),
61
    IS_LOGGED_IN((short)9, "isLoggedIn"),
62
    IP_MAP((short)10, "ipMap");
63
 
64
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
65
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
66
 
67
    static {
68
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
69
        byId.put((int)field._thriftId, field);
70
        byName.put(field.getFieldName(), field);
71
      }
72
    }
73
 
74
    /**
75
     * Find the _Fields constant that matches fieldId, or null if its not found.
76
     */
77
    public static _Fields findByThriftId(int fieldId) {
78
      return byId.get(fieldId);
79
    }
80
 
81
    /**
82
     * Find the _Fields constant that matches fieldId, throwing an exception
83
     * if it is not found.
84
     */
85
    public static _Fields findByThriftIdOrThrow(int fieldId) {
86
      _Fields fields = findByThriftId(fieldId);
87
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
88
      return fields;
89
    }
90
 
91
    /**
92
     * Find the _Fields constant that matches name, or null if its not found.
93
     */
94
    public static _Fields findByName(String name) {
95
      return byName.get(name);
96
    }
97
 
98
    private final short _thriftId;
99
    private final String _fieldName;
100
 
101
    _Fields(short thriftId, String fieldName) {
102
      _thriftId = thriftId;
103
      _fieldName = fieldName;
104
    }
105
 
106
    public short getThriftFieldId() {
107
      return _thriftId;
108
    }
109
 
110
    public String getFieldName() {
111
      return _fieldName;
112
    }
113
  }
114
 
115
  // isset id assignments
116
  private static final int __USERID_ISSET_ID = 0;
117
  private static final int __ISEMAILVERIFIED_ISSET_ID = 1;
118
  private static final int __LASTLOGIN_ISSET_ID = 2;
119
  private static final int __LASTLOGOUT_ISSET_ID = 3;
120
  private static final int __EMAILVERIFICATIONSENTON_ISSET_ID = 4;
121
  private static final int __SMSVERIFICATIONSENTON_ISSET_ID = 5;
122
  private static final int __ISSMSVERIFIED_ISSET_ID = 6;
123
  private static final int __ACTIVESINCE_ISSET_ID = 7;
124
  private static final int __ISLOGGEDIN_ISSET_ID = 8;
125
  private BitSet __isset_bit_vector = new BitSet(9);
126
 
127
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
128
    put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
129
        new FieldValueMetaData(TType.I64)));
130
    put(_Fields.IS_EMAIL_VERIFIED, new FieldMetaData("isEmailVerified", TFieldRequirementType.DEFAULT, 
131
        new FieldValueMetaData(TType.BOOL)));
132
    put(_Fields.LAST_LOGIN, new FieldMetaData("lastLogin", TFieldRequirementType.DEFAULT, 
133
        new FieldValueMetaData(TType.I64)));
134
    put(_Fields.LAST_LOGOUT, new FieldMetaData("lastLogout", TFieldRequirementType.DEFAULT, 
135
        new FieldValueMetaData(TType.I64)));
136
    put(_Fields.EMAIL_VERIFICATION_SENT_ON, new FieldMetaData("emailVerificationSentOn", TFieldRequirementType.DEFAULT, 
137
        new FieldValueMetaData(TType.I64)));
138
    put(_Fields.SMS_VERIFICATION_SENT_ON, new FieldMetaData("smsVerificationSentOn", TFieldRequirementType.DEFAULT, 
139
        new FieldValueMetaData(TType.I64)));
140
    put(_Fields.IS_SMSVERIFIED, new FieldMetaData("isSMSVerified", TFieldRequirementType.DEFAULT, 
141
        new FieldValueMetaData(TType.BOOL)));
142
    put(_Fields.ACTIVE_SINCE, new FieldMetaData("activeSince", TFieldRequirementType.DEFAULT, 
143
        new FieldValueMetaData(TType.I64)));
144
    put(_Fields.IS_LOGGED_IN, new FieldMetaData("isLoggedIn", TFieldRequirementType.DEFAULT, 
145
        new FieldValueMetaData(TType.BOOL)));
146
    put(_Fields.IP_MAP, new FieldMetaData("ipMap", TFieldRequirementType.DEFAULT, 
147
        new StructMetaData(TType.STRUCT, TIPMap.class)));
148
  }});
149
 
150
  static {
151
    FieldMetaData.addStructMetaDataMap(TUserState.class, metaDataMap);
152
  }
153
 
154
  public TUserState() {
155
  }
156
 
157
  public TUserState(
158
    long userId,
159
    boolean isEmailVerified,
160
    long lastLogin,
161
    long lastLogout,
162
    long emailVerificationSentOn,
163
    long smsVerificationSentOn,
164
    boolean isSMSVerified,
165
    long activeSince,
166
    boolean isLoggedIn,
167
    TIPMap ipMap)
168
  {
169
    this();
170
    this.userId = userId;
171
    setUserIdIsSet(true);
172
    this.isEmailVerified = isEmailVerified;
173
    setIsEmailVerifiedIsSet(true);
174
    this.lastLogin = lastLogin;
175
    setLastLoginIsSet(true);
176
    this.lastLogout = lastLogout;
177
    setLastLogoutIsSet(true);
178
    this.emailVerificationSentOn = emailVerificationSentOn;
179
    setEmailVerificationSentOnIsSet(true);
180
    this.smsVerificationSentOn = smsVerificationSentOn;
181
    setSmsVerificationSentOnIsSet(true);
182
    this.isSMSVerified = isSMSVerified;
183
    setIsSMSVerifiedIsSet(true);
184
    this.activeSince = activeSince;
185
    setActiveSinceIsSet(true);
186
    this.isLoggedIn = isLoggedIn;
187
    setIsLoggedInIsSet(true);
188
    this.ipMap = ipMap;
189
  }
190
 
191
  /**
192
   * Performs a deep copy on <i>other</i>.
193
   */
194
  public TUserState(TUserState other) {
195
    __isset_bit_vector.clear();
196
    __isset_bit_vector.or(other.__isset_bit_vector);
197
    this.userId = other.userId;
198
    this.isEmailVerified = other.isEmailVerified;
199
    this.lastLogin = other.lastLogin;
200
    this.lastLogout = other.lastLogout;
201
    this.emailVerificationSentOn = other.emailVerificationSentOn;
202
    this.smsVerificationSentOn = other.smsVerificationSentOn;
203
    this.isSMSVerified = other.isSMSVerified;
204
    this.activeSince = other.activeSince;
205
    this.isLoggedIn = other.isLoggedIn;
206
    if (other.isSetIpMap()) {
207
      this.ipMap = new TIPMap(other.ipMap);
208
    }
209
  }
210
 
211
  public TUserState deepCopy() {
212
    return new TUserState(this);
213
  }
214
 
215
  @Deprecated
216
  public TUserState clone() {
217
    return new TUserState(this);
218
  }
219
 
220
  public long getUserId() {
221
    return this.userId;
222
  }
223
 
224
  public TUserState setUserId(long userId) {
225
    this.userId = userId;
226
    setUserIdIsSet(true);
227
    return this;
228
  }
229
 
230
  public void unsetUserId() {
231
    __isset_bit_vector.clear(__USERID_ISSET_ID);
232
  }
233
 
234
  /** Returns true if field userId is set (has been asigned a value) and false otherwise */
235
  public boolean isSetUserId() {
236
    return __isset_bit_vector.get(__USERID_ISSET_ID);
237
  }
238
 
239
  public void setUserIdIsSet(boolean value) {
240
    __isset_bit_vector.set(__USERID_ISSET_ID, value);
241
  }
242
 
243
  public boolean isIsEmailVerified() {
244
    return this.isEmailVerified;
245
  }
246
 
247
  public TUserState setIsEmailVerified(boolean isEmailVerified) {
248
    this.isEmailVerified = isEmailVerified;
249
    setIsEmailVerifiedIsSet(true);
250
    return this;
251
  }
252
 
253
  public void unsetIsEmailVerified() {
254
    __isset_bit_vector.clear(__ISEMAILVERIFIED_ISSET_ID);
255
  }
256
 
257
  /** Returns true if field isEmailVerified is set (has been asigned a value) and false otherwise */
258
  public boolean isSetIsEmailVerified() {
259
    return __isset_bit_vector.get(__ISEMAILVERIFIED_ISSET_ID);
260
  }
261
 
262
  public void setIsEmailVerifiedIsSet(boolean value) {
263
    __isset_bit_vector.set(__ISEMAILVERIFIED_ISSET_ID, value);
264
  }
265
 
266
  public long getLastLogin() {
267
    return this.lastLogin;
268
  }
269
 
270
  public TUserState setLastLogin(long lastLogin) {
271
    this.lastLogin = lastLogin;
272
    setLastLoginIsSet(true);
273
    return this;
274
  }
275
 
276
  public void unsetLastLogin() {
277
    __isset_bit_vector.clear(__LASTLOGIN_ISSET_ID);
278
  }
279
 
280
  /** Returns true if field lastLogin is set (has been asigned a value) and false otherwise */
281
  public boolean isSetLastLogin() {
282
    return __isset_bit_vector.get(__LASTLOGIN_ISSET_ID);
283
  }
284
 
285
  public void setLastLoginIsSet(boolean value) {
286
    __isset_bit_vector.set(__LASTLOGIN_ISSET_ID, value);
287
  }
288
 
289
  public long getLastLogout() {
290
    return this.lastLogout;
291
  }
292
 
293
  public TUserState setLastLogout(long lastLogout) {
294
    this.lastLogout = lastLogout;
295
    setLastLogoutIsSet(true);
296
    return this;
297
  }
298
 
299
  public void unsetLastLogout() {
300
    __isset_bit_vector.clear(__LASTLOGOUT_ISSET_ID);
301
  }
302
 
303
  /** Returns true if field lastLogout is set (has been asigned a value) and false otherwise */
304
  public boolean isSetLastLogout() {
305
    return __isset_bit_vector.get(__LASTLOGOUT_ISSET_ID);
306
  }
307
 
308
  public void setLastLogoutIsSet(boolean value) {
309
    __isset_bit_vector.set(__LASTLOGOUT_ISSET_ID, value);
310
  }
311
 
312
  public long getEmailVerificationSentOn() {
313
    return this.emailVerificationSentOn;
314
  }
315
 
316
  public TUserState setEmailVerificationSentOn(long emailVerificationSentOn) {
317
    this.emailVerificationSentOn = emailVerificationSentOn;
318
    setEmailVerificationSentOnIsSet(true);
319
    return this;
320
  }
321
 
322
  public void unsetEmailVerificationSentOn() {
323
    __isset_bit_vector.clear(__EMAILVERIFICATIONSENTON_ISSET_ID);
324
  }
325
 
326
  /** Returns true if field emailVerificationSentOn is set (has been asigned a value) and false otherwise */
327
  public boolean isSetEmailVerificationSentOn() {
328
    return __isset_bit_vector.get(__EMAILVERIFICATIONSENTON_ISSET_ID);
329
  }
330
 
331
  public void setEmailVerificationSentOnIsSet(boolean value) {
332
    __isset_bit_vector.set(__EMAILVERIFICATIONSENTON_ISSET_ID, value);
333
  }
334
 
335
  public long getSmsVerificationSentOn() {
336
    return this.smsVerificationSentOn;
337
  }
338
 
339
  public TUserState setSmsVerificationSentOn(long smsVerificationSentOn) {
340
    this.smsVerificationSentOn = smsVerificationSentOn;
341
    setSmsVerificationSentOnIsSet(true);
342
    return this;
343
  }
344
 
345
  public void unsetSmsVerificationSentOn() {
346
    __isset_bit_vector.clear(__SMSVERIFICATIONSENTON_ISSET_ID);
347
  }
348
 
349
  /** Returns true if field smsVerificationSentOn is set (has been asigned a value) and false otherwise */
350
  public boolean isSetSmsVerificationSentOn() {
351
    return __isset_bit_vector.get(__SMSVERIFICATIONSENTON_ISSET_ID);
352
  }
353
 
354
  public void setSmsVerificationSentOnIsSet(boolean value) {
355
    __isset_bit_vector.set(__SMSVERIFICATIONSENTON_ISSET_ID, value);
356
  }
357
 
358
  public boolean isIsSMSVerified() {
359
    return this.isSMSVerified;
360
  }
361
 
362
  public TUserState setIsSMSVerified(boolean isSMSVerified) {
363
    this.isSMSVerified = isSMSVerified;
364
    setIsSMSVerifiedIsSet(true);
365
    return this;
366
  }
367
 
368
  public void unsetIsSMSVerified() {
369
    __isset_bit_vector.clear(__ISSMSVERIFIED_ISSET_ID);
370
  }
371
 
372
  /** Returns true if field isSMSVerified is set (has been asigned a value) and false otherwise */
373
  public boolean isSetIsSMSVerified() {
374
    return __isset_bit_vector.get(__ISSMSVERIFIED_ISSET_ID);
375
  }
376
 
377
  public void setIsSMSVerifiedIsSet(boolean value) {
378
    __isset_bit_vector.set(__ISSMSVERIFIED_ISSET_ID, value);
379
  }
380
 
381
  public long getActiveSince() {
382
    return this.activeSince;
383
  }
384
 
385
  public TUserState setActiveSince(long activeSince) {
386
    this.activeSince = activeSince;
387
    setActiveSinceIsSet(true);
388
    return this;
389
  }
390
 
391
  public void unsetActiveSince() {
392
    __isset_bit_vector.clear(__ACTIVESINCE_ISSET_ID);
393
  }
394
 
395
  /** Returns true if field activeSince is set (has been asigned a value) and false otherwise */
396
  public boolean isSetActiveSince() {
397
    return __isset_bit_vector.get(__ACTIVESINCE_ISSET_ID);
398
  }
399
 
400
  public void setActiveSinceIsSet(boolean value) {
401
    __isset_bit_vector.set(__ACTIVESINCE_ISSET_ID, value);
402
  }
403
 
404
  public boolean isIsLoggedIn() {
405
    return this.isLoggedIn;
406
  }
407
 
408
  public TUserState setIsLoggedIn(boolean isLoggedIn) {
409
    this.isLoggedIn = isLoggedIn;
410
    setIsLoggedInIsSet(true);
411
    return this;
412
  }
413
 
414
  public void unsetIsLoggedIn() {
415
    __isset_bit_vector.clear(__ISLOGGEDIN_ISSET_ID);
416
  }
417
 
418
  /** Returns true if field isLoggedIn is set (has been asigned a value) and false otherwise */
419
  public boolean isSetIsLoggedIn() {
420
    return __isset_bit_vector.get(__ISLOGGEDIN_ISSET_ID);
421
  }
422
 
423
  public void setIsLoggedInIsSet(boolean value) {
424
    __isset_bit_vector.set(__ISLOGGEDIN_ISSET_ID, value);
425
  }
426
 
427
  public TIPMap getIpMap() {
428
    return this.ipMap;
429
  }
430
 
431
  public TUserState setIpMap(TIPMap ipMap) {
432
    this.ipMap = ipMap;
433
    return this;
434
  }
435
 
436
  public void unsetIpMap() {
437
    this.ipMap = null;
438
  }
439
 
440
  /** Returns true if field ipMap is set (has been asigned a value) and false otherwise */
441
  public boolean isSetIpMap() {
442
    return this.ipMap != null;
443
  }
444
 
445
  public void setIpMapIsSet(boolean value) {
446
    if (!value) {
447
      this.ipMap = null;
448
    }
449
  }
450
 
451
  public void setFieldValue(_Fields field, Object value) {
452
    switch (field) {
453
    case USER_ID:
454
      if (value == null) {
455
        unsetUserId();
456
      } else {
457
        setUserId((Long)value);
458
      }
459
      break;
460
 
461
    case IS_EMAIL_VERIFIED:
462
      if (value == null) {
463
        unsetIsEmailVerified();
464
      } else {
465
        setIsEmailVerified((Boolean)value);
466
      }
467
      break;
468
 
469
    case LAST_LOGIN:
470
      if (value == null) {
471
        unsetLastLogin();
472
      } else {
473
        setLastLogin((Long)value);
474
      }
475
      break;
476
 
477
    case LAST_LOGOUT:
478
      if (value == null) {
479
        unsetLastLogout();
480
      } else {
481
        setLastLogout((Long)value);
482
      }
483
      break;
484
 
485
    case EMAIL_VERIFICATION_SENT_ON:
486
      if (value == null) {
487
        unsetEmailVerificationSentOn();
488
      } else {
489
        setEmailVerificationSentOn((Long)value);
490
      }
491
      break;
492
 
493
    case SMS_VERIFICATION_SENT_ON:
494
      if (value == null) {
495
        unsetSmsVerificationSentOn();
496
      } else {
497
        setSmsVerificationSentOn((Long)value);
498
      }
499
      break;
500
 
501
    case IS_SMSVERIFIED:
502
      if (value == null) {
503
        unsetIsSMSVerified();
504
      } else {
505
        setIsSMSVerified((Boolean)value);
506
      }
507
      break;
508
 
509
    case ACTIVE_SINCE:
510
      if (value == null) {
511
        unsetActiveSince();
512
      } else {
513
        setActiveSince((Long)value);
514
      }
515
      break;
516
 
517
    case IS_LOGGED_IN:
518
      if (value == null) {
519
        unsetIsLoggedIn();
520
      } else {
521
        setIsLoggedIn((Boolean)value);
522
      }
523
      break;
524
 
525
    case IP_MAP:
526
      if (value == null) {
527
        unsetIpMap();
528
      } else {
529
        setIpMap((TIPMap)value);
530
      }
531
      break;
532
 
533
    }
534
  }
535
 
536
  public void setFieldValue(int fieldID, Object value) {
537
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
538
  }
539
 
540
  public Object getFieldValue(_Fields field) {
541
    switch (field) {
542
    case USER_ID:
543
      return new Long(getUserId());
544
 
545
    case IS_EMAIL_VERIFIED:
546
      return new Boolean(isIsEmailVerified());
547
 
548
    case LAST_LOGIN:
549
      return new Long(getLastLogin());
550
 
551
    case LAST_LOGOUT:
552
      return new Long(getLastLogout());
553
 
554
    case EMAIL_VERIFICATION_SENT_ON:
555
      return new Long(getEmailVerificationSentOn());
556
 
557
    case SMS_VERIFICATION_SENT_ON:
558
      return new Long(getSmsVerificationSentOn());
559
 
560
    case IS_SMSVERIFIED:
561
      return new Boolean(isIsSMSVerified());
562
 
563
    case ACTIVE_SINCE:
564
      return new Long(getActiveSince());
565
 
566
    case IS_LOGGED_IN:
567
      return new Boolean(isIsLoggedIn());
568
 
569
    case IP_MAP:
570
      return getIpMap();
571
 
572
    }
573
    throw new IllegalStateException();
574
  }
575
 
576
  public Object getFieldValue(int fieldId) {
577
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
578
  }
579
 
580
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
581
  public boolean isSet(_Fields field) {
582
    switch (field) {
583
    case USER_ID:
584
      return isSetUserId();
585
    case IS_EMAIL_VERIFIED:
586
      return isSetIsEmailVerified();
587
    case LAST_LOGIN:
588
      return isSetLastLogin();
589
    case LAST_LOGOUT:
590
      return isSetLastLogout();
591
    case EMAIL_VERIFICATION_SENT_ON:
592
      return isSetEmailVerificationSentOn();
593
    case SMS_VERIFICATION_SENT_ON:
594
      return isSetSmsVerificationSentOn();
595
    case IS_SMSVERIFIED:
596
      return isSetIsSMSVerified();
597
    case ACTIVE_SINCE:
598
      return isSetActiveSince();
599
    case IS_LOGGED_IN:
600
      return isSetIsLoggedIn();
601
    case IP_MAP:
602
      return isSetIpMap();
603
    }
604
    throw new IllegalStateException();
605
  }
606
 
607
  public boolean isSet(int fieldID) {
608
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
609
  }
610
 
611
  @Override
612
  public boolean equals(Object that) {
613
    if (that == null)
614
      return false;
615
    if (that instanceof TUserState)
616
      return this.equals((TUserState)that);
617
    return false;
618
  }
619
 
620
  public boolean equals(TUserState that) {
621
    if (that == null)
622
      return false;
623
 
624
    boolean this_present_userId = true;
625
    boolean that_present_userId = true;
626
    if (this_present_userId || that_present_userId) {
627
      if (!(this_present_userId && that_present_userId))
628
        return false;
629
      if (this.userId != that.userId)
630
        return false;
631
    }
632
 
633
    boolean this_present_isEmailVerified = true;
634
    boolean that_present_isEmailVerified = true;
635
    if (this_present_isEmailVerified || that_present_isEmailVerified) {
636
      if (!(this_present_isEmailVerified && that_present_isEmailVerified))
637
        return false;
638
      if (this.isEmailVerified != that.isEmailVerified)
639
        return false;
640
    }
641
 
642
    boolean this_present_lastLogin = true;
643
    boolean that_present_lastLogin = true;
644
    if (this_present_lastLogin || that_present_lastLogin) {
645
      if (!(this_present_lastLogin && that_present_lastLogin))
646
        return false;
647
      if (this.lastLogin != that.lastLogin)
648
        return false;
649
    }
650
 
651
    boolean this_present_lastLogout = true;
652
    boolean that_present_lastLogout = true;
653
    if (this_present_lastLogout || that_present_lastLogout) {
654
      if (!(this_present_lastLogout && that_present_lastLogout))
655
        return false;
656
      if (this.lastLogout != that.lastLogout)
657
        return false;
658
    }
659
 
660
    boolean this_present_emailVerificationSentOn = true;
661
    boolean that_present_emailVerificationSentOn = true;
662
    if (this_present_emailVerificationSentOn || that_present_emailVerificationSentOn) {
663
      if (!(this_present_emailVerificationSentOn && that_present_emailVerificationSentOn))
664
        return false;
665
      if (this.emailVerificationSentOn != that.emailVerificationSentOn)
666
        return false;
667
    }
668
 
669
    boolean this_present_smsVerificationSentOn = true;
670
    boolean that_present_smsVerificationSentOn = true;
671
    if (this_present_smsVerificationSentOn || that_present_smsVerificationSentOn) {
672
      if (!(this_present_smsVerificationSentOn && that_present_smsVerificationSentOn))
673
        return false;
674
      if (this.smsVerificationSentOn != that.smsVerificationSentOn)
675
        return false;
676
    }
677
 
678
    boolean this_present_isSMSVerified = true;
679
    boolean that_present_isSMSVerified = true;
680
    if (this_present_isSMSVerified || that_present_isSMSVerified) {
681
      if (!(this_present_isSMSVerified && that_present_isSMSVerified))
682
        return false;
683
      if (this.isSMSVerified != that.isSMSVerified)
684
        return false;
685
    }
686
 
687
    boolean this_present_activeSince = true;
688
    boolean that_present_activeSince = true;
689
    if (this_present_activeSince || that_present_activeSince) {
690
      if (!(this_present_activeSince && that_present_activeSince))
691
        return false;
692
      if (this.activeSince != that.activeSince)
693
        return false;
694
    }
695
 
696
    boolean this_present_isLoggedIn = true;
697
    boolean that_present_isLoggedIn = true;
698
    if (this_present_isLoggedIn || that_present_isLoggedIn) {
699
      if (!(this_present_isLoggedIn && that_present_isLoggedIn))
700
        return false;
701
      if (this.isLoggedIn != that.isLoggedIn)
702
        return false;
703
    }
704
 
705
    boolean this_present_ipMap = true && this.isSetIpMap();
706
    boolean that_present_ipMap = true && that.isSetIpMap();
707
    if (this_present_ipMap || that_present_ipMap) {
708
      if (!(this_present_ipMap && that_present_ipMap))
709
        return false;
710
      if (!this.ipMap.equals(that.ipMap))
711
        return false;
712
    }
713
 
714
    return true;
715
  }
716
 
717
  @Override
718
  public int hashCode() {
719
    return 0;
720
  }
721
 
722
  public void read(TProtocol iprot) throws TException {
723
    TField field;
724
    iprot.readStructBegin();
725
    while (true)
726
    {
727
      field = iprot.readFieldBegin();
728
      if (field.type == TType.STOP) { 
729
        break;
730
      }
731
      _Fields fieldId = _Fields.findByThriftId(field.id);
732
      if (fieldId == null) {
733
        TProtocolUtil.skip(iprot, field.type);
734
      } else {
735
        switch (fieldId) {
736
          case USER_ID:
737
            if (field.type == TType.I64) {
738
              this.userId = iprot.readI64();
739
              setUserIdIsSet(true);
740
            } else { 
741
              TProtocolUtil.skip(iprot, field.type);
742
            }
743
            break;
744
          case IS_EMAIL_VERIFIED:
745
            if (field.type == TType.BOOL) {
746
              this.isEmailVerified = iprot.readBool();
747
              setIsEmailVerifiedIsSet(true);
748
            } else { 
749
              TProtocolUtil.skip(iprot, field.type);
750
            }
751
            break;
752
          case LAST_LOGIN:
753
            if (field.type == TType.I64) {
754
              this.lastLogin = iprot.readI64();
755
              setLastLoginIsSet(true);
756
            } else { 
757
              TProtocolUtil.skip(iprot, field.type);
758
            }
759
            break;
760
          case LAST_LOGOUT:
761
            if (field.type == TType.I64) {
762
              this.lastLogout = iprot.readI64();
763
              setLastLogoutIsSet(true);
764
            } else { 
765
              TProtocolUtil.skip(iprot, field.type);
766
            }
767
            break;
768
          case EMAIL_VERIFICATION_SENT_ON:
769
            if (field.type == TType.I64) {
770
              this.emailVerificationSentOn = iprot.readI64();
771
              setEmailVerificationSentOnIsSet(true);
772
            } else { 
773
              TProtocolUtil.skip(iprot, field.type);
774
            }
775
            break;
776
          case SMS_VERIFICATION_SENT_ON:
777
            if (field.type == TType.I64) {
778
              this.smsVerificationSentOn = iprot.readI64();
779
              setSmsVerificationSentOnIsSet(true);
780
            } else { 
781
              TProtocolUtil.skip(iprot, field.type);
782
            }
783
            break;
784
          case IS_SMSVERIFIED:
785
            if (field.type == TType.BOOL) {
786
              this.isSMSVerified = iprot.readBool();
787
              setIsSMSVerifiedIsSet(true);
788
            } else { 
789
              TProtocolUtil.skip(iprot, field.type);
790
            }
791
            break;
792
          case ACTIVE_SINCE:
793
            if (field.type == TType.I64) {
794
              this.activeSince = iprot.readI64();
795
              setActiveSinceIsSet(true);
796
            } else { 
797
              TProtocolUtil.skip(iprot, field.type);
798
            }
799
            break;
800
          case IS_LOGGED_IN:
801
            if (field.type == TType.BOOL) {
802
              this.isLoggedIn = iprot.readBool();
803
              setIsLoggedInIsSet(true);
804
            } else { 
805
              TProtocolUtil.skip(iprot, field.type);
806
            }
807
            break;
808
          case IP_MAP:
809
            if (field.type == TType.STRUCT) {
810
              this.ipMap = new TIPMap();
811
              this.ipMap.read(iprot);
812
            } else { 
813
              TProtocolUtil.skip(iprot, field.type);
814
            }
815
            break;
816
        }
817
        iprot.readFieldEnd();
818
      }
819
    }
820
    iprot.readStructEnd();
821
    validate();
822
  }
823
 
824
  public void write(TProtocol oprot) throws TException {
825
    validate();
826
 
827
    oprot.writeStructBegin(STRUCT_DESC);
828
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
829
    oprot.writeI64(this.userId);
830
    oprot.writeFieldEnd();
831
    oprot.writeFieldBegin(IS_EMAIL_VERIFIED_FIELD_DESC);
832
    oprot.writeBool(this.isEmailVerified);
833
    oprot.writeFieldEnd();
834
    oprot.writeFieldBegin(LAST_LOGIN_FIELD_DESC);
835
    oprot.writeI64(this.lastLogin);
836
    oprot.writeFieldEnd();
837
    oprot.writeFieldBegin(LAST_LOGOUT_FIELD_DESC);
838
    oprot.writeI64(this.lastLogout);
839
    oprot.writeFieldEnd();
840
    oprot.writeFieldBegin(EMAIL_VERIFICATION_SENT_ON_FIELD_DESC);
841
    oprot.writeI64(this.emailVerificationSentOn);
842
    oprot.writeFieldEnd();
843
    oprot.writeFieldBegin(SMS_VERIFICATION_SENT_ON_FIELD_DESC);
844
    oprot.writeI64(this.smsVerificationSentOn);
845
    oprot.writeFieldEnd();
846
    oprot.writeFieldBegin(IS_SMSVERIFIED_FIELD_DESC);
847
    oprot.writeBool(this.isSMSVerified);
848
    oprot.writeFieldEnd();
849
    oprot.writeFieldBegin(ACTIVE_SINCE_FIELD_DESC);
850
    oprot.writeI64(this.activeSince);
851
    oprot.writeFieldEnd();
852
    oprot.writeFieldBegin(IS_LOGGED_IN_FIELD_DESC);
853
    oprot.writeBool(this.isLoggedIn);
854
    oprot.writeFieldEnd();
855
    if (this.ipMap != null) {
856
      oprot.writeFieldBegin(IP_MAP_FIELD_DESC);
857
      this.ipMap.write(oprot);
858
      oprot.writeFieldEnd();
859
    }
860
    oprot.writeFieldStop();
861
    oprot.writeStructEnd();
862
  }
863
 
864
  @Override
865
  public String toString() {
866
    StringBuilder sb = new StringBuilder("TUserState(");
867
    boolean first = true;
868
 
869
    sb.append("userId:");
870
    sb.append(this.userId);
871
    first = false;
872
    if (!first) sb.append(", ");
873
    sb.append("isEmailVerified:");
874
    sb.append(this.isEmailVerified);
875
    first = false;
876
    if (!first) sb.append(", ");
877
    sb.append("lastLogin:");
878
    sb.append(this.lastLogin);
879
    first = false;
880
    if (!first) sb.append(", ");
881
    sb.append("lastLogout:");
882
    sb.append(this.lastLogout);
883
    first = false;
884
    if (!first) sb.append(", ");
885
    sb.append("emailVerificationSentOn:");
886
    sb.append(this.emailVerificationSentOn);
887
    first = false;
888
    if (!first) sb.append(", ");
889
    sb.append("smsVerificationSentOn:");
890
    sb.append(this.smsVerificationSentOn);
891
    first = false;
892
    if (!first) sb.append(", ");
893
    sb.append("isSMSVerified:");
894
    sb.append(this.isSMSVerified);
895
    first = false;
896
    if (!first) sb.append(", ");
897
    sb.append("activeSince:");
898
    sb.append(this.activeSince);
899
    first = false;
900
    if (!first) sb.append(", ");
901
    sb.append("isLoggedIn:");
902
    sb.append(this.isLoggedIn);
903
    first = false;
904
    if (!first) sb.append(", ");
905
    sb.append("ipMap:");
906
    if (this.ipMap == null) {
907
      sb.append("null");
908
    } else {
909
      sb.append(this.ipMap);
910
    }
911
    first = false;
912
    sb.append(")");
913
    return sb.toString();
914
  }
915
 
916
  public void validate() throws TException {
917
    // check for required fields
918
  }
919
 
920
}
921