Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
553 chandransh 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
/**
27
 * The user structure holding the basic information that identifies the user.
28
 * *
29
 */
571 rajveer 30
public class User implements TBase<User._Fields>, java.io.Serializable, Cloneable, Comparable<User> {
553 chandransh 31
  private static final TStruct STRUCT_DESC = new TStruct("User");
32
 
33
  private static final TField USER_ID_FIELD_DESC = new TField("userId", TType.I64, (short)1);
34
  private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)2);
35
  private static final TField PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)3);
36
  private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)4);
571 rajveer 37
  private static final TField DATE_OF_BIRTH_FIELD_DESC = new TField("dateOfBirth", TType.STRING, (short)5);
553 chandransh 38
  private static final TField SEX_FIELD_DESC = new TField("sex", TType.I32, (short)6);
571 rajveer 39
  private static final TField MOBILE_NUMBER_FIELD_DESC = new TField("mobileNumber", TType.STRING, (short)7);
553 chandransh 40
  private static final TField SOCIAL_HANDLES_FIELD_DESC = new TField("socialHandles", TType.STRUCT, (short)8);
41
  private static final TField ADDRESSES_FIELD_DESC = new TField("addresses", TType.LIST, (short)9);
42
  private static final TField DEFAULT_ADDRESS_ID_FIELD_DESC = new TField("defaultAddressId", TType.I64, (short)10);
43
  private static final TField COMMUNICATION_EMAIL_FIELD_DESC = new TField("communicationEmail", TType.STRING, (short)11);
44
  private static final TField ACTIVE_CART_ID_FIELD_DESC = new TField("activeCartId", TType.I64, (short)12);
45
  private static final TField JSESSION_ID_FIELD_DESC = new TField("jsessionId", TType.STRING, (short)13);
46
  private static final TField IS_ANONYMOUS_FIELD_DESC = new TField("isAnonymous", TType.BOOL, (short)14);
2020 vikas 47
  private static final TField SOURCE_FIELD_DESC = new TField("source", TType.STRING, (short)15);
2816 vikas 48
  private static final TField SOURCE_START_TIME_FIELD_DESC = new TField("sourceStartTime", TType.I64, (short)16);
553 chandransh 49
 
50
  private long userId;
51
  private String email;
52
  private String password;
53
  private String name;
571 rajveer 54
  private String dateOfBirth;
553 chandransh 55
  private Sex sex;
571 rajveer 56
  private String mobileNumber;
553 chandransh 57
  private SocialHandles socialHandles;
58
  private List<Address> addresses;
59
  private long defaultAddressId;
60
  private String communicationEmail;
61
  private long activeCartId;
62
  private String jsessionId;
63
  private boolean isAnonymous;
2020 vikas 64
  private String source;
2816 vikas 65
  private long sourceStartTime;
553 chandransh 66
 
67
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
68
  public enum _Fields implements TFieldIdEnum {
69
    USER_ID((short)1, "userId"),
70
    EMAIL((short)2, "email"),
71
    PASSWORD((short)3, "password"),
72
    NAME((short)4, "name"),
73
    DATE_OF_BIRTH((short)5, "dateOfBirth"),
74
    /**
75
     * 
76
     * @see Sex
77
     */
78
    SEX((short)6, "sex"),
571 rajveer 79
    MOBILE_NUMBER((short)7, "mobileNumber"),
553 chandransh 80
    SOCIAL_HANDLES((short)8, "socialHandles"),
81
    ADDRESSES((short)9, "addresses"),
82
    DEFAULT_ADDRESS_ID((short)10, "defaultAddressId"),
83
    COMMUNICATION_EMAIL((short)11, "communicationEmail"),
84
    ACTIVE_CART_ID((short)12, "activeCartId"),
85
    JSESSION_ID((short)13, "jsessionId"),
2020 vikas 86
    IS_ANONYMOUS((short)14, "isAnonymous"),
2816 vikas 87
    SOURCE((short)15, "source"),
88
    SOURCE_START_TIME((short)16, "sourceStartTime");
553 chandransh 89
 
90
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
91
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
92
 
93
    static {
94
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
95
        byId.put((int)field._thriftId, field);
96
        byName.put(field.getFieldName(), field);
97
      }
98
    }
99
 
100
    /**
101
     * Find the _Fields constant that matches fieldId, or null if its not found.
102
     */
103
    public static _Fields findByThriftId(int fieldId) {
104
      return byId.get(fieldId);
105
    }
106
 
107
    /**
108
     * Find the _Fields constant that matches fieldId, throwing an exception
109
     * if it is not found.
110
     */
111
    public static _Fields findByThriftIdOrThrow(int fieldId) {
112
      _Fields fields = findByThriftId(fieldId);
113
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
114
      return fields;
115
    }
116
 
117
    /**
118
     * Find the _Fields constant that matches name, or null if its not found.
119
     */
120
    public static _Fields findByName(String name) {
121
      return byName.get(name);
122
    }
123
 
124
    private final short _thriftId;
125
    private final String _fieldName;
126
 
127
    _Fields(short thriftId, String fieldName) {
128
      _thriftId = thriftId;
129
      _fieldName = fieldName;
130
    }
131
 
132
    public short getThriftFieldId() {
133
      return _thriftId;
134
    }
135
 
136
    public String getFieldName() {
137
      return _fieldName;
138
    }
139
  }
140
 
141
  // isset id assignments
142
  private static final int __USERID_ISSET_ID = 0;
571 rajveer 143
  private static final int __DEFAULTADDRESSID_ISSET_ID = 1;
144
  private static final int __ACTIVECARTID_ISSET_ID = 2;
145
  private static final int __ISANONYMOUS_ISSET_ID = 3;
2816 vikas 146
  private static final int __SOURCESTARTTIME_ISSET_ID = 4;
147
  private BitSet __isset_bit_vector = new BitSet(5);
553 chandransh 148
 
149
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
150
    put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
151
        new FieldValueMetaData(TType.I64)));
152
    put(_Fields.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
153
        new FieldValueMetaData(TType.STRING)));
154
    put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
155
        new FieldValueMetaData(TType.STRING)));
156
    put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.DEFAULT, 
157
        new FieldValueMetaData(TType.STRING)));
158
    put(_Fields.DATE_OF_BIRTH, new FieldMetaData("dateOfBirth", TFieldRequirementType.DEFAULT, 
571 rajveer 159
        new FieldValueMetaData(TType.STRING)));
553 chandransh 160
    put(_Fields.SEX, new FieldMetaData("sex", TFieldRequirementType.DEFAULT, 
161
        new EnumMetaData(TType.ENUM, Sex.class)));
571 rajveer 162
    put(_Fields.MOBILE_NUMBER, new FieldMetaData("mobileNumber", TFieldRequirementType.DEFAULT, 
163
        new FieldValueMetaData(TType.STRING)));
553 chandransh 164
    put(_Fields.SOCIAL_HANDLES, new FieldMetaData("socialHandles", TFieldRequirementType.DEFAULT, 
165
        new StructMetaData(TType.STRUCT, SocialHandles.class)));
166
    put(_Fields.ADDRESSES, new FieldMetaData("addresses", TFieldRequirementType.DEFAULT, 
167
        new ListMetaData(TType.LIST, 
168
            new StructMetaData(TType.STRUCT, Address.class))));
169
    put(_Fields.DEFAULT_ADDRESS_ID, new FieldMetaData("defaultAddressId", TFieldRequirementType.DEFAULT, 
170
        new FieldValueMetaData(TType.I64)));
171
    put(_Fields.COMMUNICATION_EMAIL, new FieldMetaData("communicationEmail", TFieldRequirementType.DEFAULT, 
172
        new FieldValueMetaData(TType.STRING)));
173
    put(_Fields.ACTIVE_CART_ID, new FieldMetaData("activeCartId", TFieldRequirementType.DEFAULT, 
174
        new FieldValueMetaData(TType.I64)));
175
    put(_Fields.JSESSION_ID, new FieldMetaData("jsessionId", TFieldRequirementType.DEFAULT, 
176
        new FieldValueMetaData(TType.STRING)));
177
    put(_Fields.IS_ANONYMOUS, new FieldMetaData("isAnonymous", TFieldRequirementType.DEFAULT, 
178
        new FieldValueMetaData(TType.BOOL)));
2020 vikas 179
    put(_Fields.SOURCE, new FieldMetaData("source", TFieldRequirementType.DEFAULT, 
180
        new FieldValueMetaData(TType.STRING)));
2816 vikas 181
    put(_Fields.SOURCE_START_TIME, new FieldMetaData("sourceStartTime", TFieldRequirementType.DEFAULT, 
182
        new FieldValueMetaData(TType.I64)));
553 chandransh 183
  }});
184
 
185
  static {
186
    FieldMetaData.addStructMetaDataMap(User.class, metaDataMap);
187
  }
188
 
189
  public User() {
190
  }
191
 
192
  public User(
193
    long userId,
194
    String email,
195
    String password,
196
    String name,
571 rajveer 197
    String dateOfBirth,
553 chandransh 198
    Sex sex,
571 rajveer 199
    String mobileNumber,
553 chandransh 200
    SocialHandles socialHandles,
201
    List<Address> addresses,
202
    long defaultAddressId,
203
    String communicationEmail,
204
    long activeCartId,
205
    String jsessionId,
2020 vikas 206
    boolean isAnonymous,
2816 vikas 207
    String source,
208
    long sourceStartTime)
553 chandransh 209
  {
210
    this();
211
    this.userId = userId;
212
    setUserIdIsSet(true);
213
    this.email = email;
214
    this.password = password;
215
    this.name = name;
216
    this.dateOfBirth = dateOfBirth;
217
    this.sex = sex;
571 rajveer 218
    this.mobileNumber = mobileNumber;
553 chandransh 219
    this.socialHandles = socialHandles;
220
    this.addresses = addresses;
221
    this.defaultAddressId = defaultAddressId;
222
    setDefaultAddressIdIsSet(true);
223
    this.communicationEmail = communicationEmail;
224
    this.activeCartId = activeCartId;
225
    setActiveCartIdIsSet(true);
226
    this.jsessionId = jsessionId;
227
    this.isAnonymous = isAnonymous;
228
    setIsAnonymousIsSet(true);
2020 vikas 229
    this.source = source;
2816 vikas 230
    this.sourceStartTime = sourceStartTime;
231
    setSourceStartTimeIsSet(true);
553 chandransh 232
  }
233
 
234
  /**
235
   * Performs a deep copy on <i>other</i>.
236
   */
237
  public User(User other) {
238
    __isset_bit_vector.clear();
239
    __isset_bit_vector.or(other.__isset_bit_vector);
240
    this.userId = other.userId;
241
    if (other.isSetEmail()) {
242
      this.email = other.email;
243
    }
244
    if (other.isSetPassword()) {
245
      this.password = other.password;
246
    }
247
    if (other.isSetName()) {
248
      this.name = other.name;
249
    }
571 rajveer 250
    if (other.isSetDateOfBirth()) {
251
      this.dateOfBirth = other.dateOfBirth;
252
    }
553 chandransh 253
    if (other.isSetSex()) {
254
      this.sex = other.sex;
255
    }
571 rajveer 256
    if (other.isSetMobileNumber()) {
257
      this.mobileNumber = other.mobileNumber;
553 chandransh 258
    }
259
    if (other.isSetSocialHandles()) {
260
      this.socialHandles = new SocialHandles(other.socialHandles);
261
    }
262
    if (other.isSetAddresses()) {
263
      List<Address> __this__addresses = new ArrayList<Address>();
264
      for (Address other_element : other.addresses) {
265
        __this__addresses.add(new Address(other_element));
266
      }
267
      this.addresses = __this__addresses;
268
    }
269
    this.defaultAddressId = other.defaultAddressId;
270
    if (other.isSetCommunicationEmail()) {
271
      this.communicationEmail = other.communicationEmail;
272
    }
273
    this.activeCartId = other.activeCartId;
274
    if (other.isSetJsessionId()) {
275
      this.jsessionId = other.jsessionId;
276
    }
277
    this.isAnonymous = other.isAnonymous;
2020 vikas 278
    if (other.isSetSource()) {
279
      this.source = other.source;
280
    }
2816 vikas 281
    this.sourceStartTime = other.sourceStartTime;
553 chandransh 282
  }
283
 
284
  public User deepCopy() {
285
    return new User(this);
286
  }
287
 
288
  @Deprecated
289
  public User clone() {
290
    return new User(this);
291
  }
292
 
293
  public long getUserId() {
294
    return this.userId;
295
  }
296
 
297
  public User setUserId(long userId) {
298
    this.userId = userId;
299
    setUserIdIsSet(true);
300
    return this;
301
  }
302
 
303
  public void unsetUserId() {
304
    __isset_bit_vector.clear(__USERID_ISSET_ID);
305
  }
306
 
307
  /** Returns true if field userId is set (has been asigned a value) and false otherwise */
308
  public boolean isSetUserId() {
309
    return __isset_bit_vector.get(__USERID_ISSET_ID);
310
  }
311
 
312
  public void setUserIdIsSet(boolean value) {
313
    __isset_bit_vector.set(__USERID_ISSET_ID, value);
314
  }
315
 
316
  public String getEmail() {
317
    return this.email;
318
  }
319
 
320
  public User setEmail(String email) {
321
    this.email = email;
322
    return this;
323
  }
324
 
325
  public void unsetEmail() {
326
    this.email = null;
327
  }
328
 
329
  /** Returns true if field email is set (has been asigned a value) and false otherwise */
330
  public boolean isSetEmail() {
331
    return this.email != null;
332
  }
333
 
334
  public void setEmailIsSet(boolean value) {
335
    if (!value) {
336
      this.email = null;
337
    }
338
  }
339
 
340
  public String getPassword() {
341
    return this.password;
342
  }
343
 
344
  public User setPassword(String password) {
345
    this.password = password;
346
    return this;
347
  }
348
 
349
  public void unsetPassword() {
350
    this.password = null;
351
  }
352
 
353
  /** Returns true if field password is set (has been asigned a value) and false otherwise */
354
  public boolean isSetPassword() {
355
    return this.password != null;
356
  }
357
 
358
  public void setPasswordIsSet(boolean value) {
359
    if (!value) {
360
      this.password = null;
361
    }
362
  }
363
 
364
  public String getName() {
365
    return this.name;
366
  }
367
 
368
  public User setName(String name) {
369
    this.name = name;
370
    return this;
371
  }
372
 
373
  public void unsetName() {
374
    this.name = null;
375
  }
376
 
377
  /** Returns true if field name is set (has been asigned a value) and false otherwise */
378
  public boolean isSetName() {
379
    return this.name != null;
380
  }
381
 
382
  public void setNameIsSet(boolean value) {
383
    if (!value) {
384
      this.name = null;
385
    }
386
  }
387
 
571 rajveer 388
  public String getDateOfBirth() {
553 chandransh 389
    return this.dateOfBirth;
390
  }
391
 
571 rajveer 392
  public User setDateOfBirth(String dateOfBirth) {
553 chandransh 393
    this.dateOfBirth = dateOfBirth;
394
    return this;
395
  }
396
 
397
  public void unsetDateOfBirth() {
571 rajveer 398
    this.dateOfBirth = null;
553 chandransh 399
  }
400
 
401
  /** Returns true if field dateOfBirth is set (has been asigned a value) and false otherwise */
402
  public boolean isSetDateOfBirth() {
571 rajveer 403
    return this.dateOfBirth != null;
553 chandransh 404
  }
405
 
406
  public void setDateOfBirthIsSet(boolean value) {
571 rajveer 407
    if (!value) {
408
      this.dateOfBirth = null;
409
    }
553 chandransh 410
  }
411
 
412
  /**
413
   * 
414
   * @see Sex
415
   */
416
  public Sex getSex() {
417
    return this.sex;
418
  }
419
 
420
  /**
421
   * 
422
   * @see Sex
423
   */
424
  public User setSex(Sex sex) {
425
    this.sex = sex;
426
    return this;
427
  }
428
 
429
  public void unsetSex() {
430
    this.sex = null;
431
  }
432
 
433
  /** Returns true if field sex is set (has been asigned a value) and false otherwise */
434
  public boolean isSetSex() {
435
    return this.sex != null;
436
  }
437
 
438
  public void setSexIsSet(boolean value) {
439
    if (!value) {
440
      this.sex = null;
441
    }
442
  }
443
 
571 rajveer 444
  public String getMobileNumber() {
445
    return this.mobileNumber;
553 chandransh 446
  }
447
 
571 rajveer 448
  public User setMobileNumber(String mobileNumber) {
449
    this.mobileNumber = mobileNumber;
553 chandransh 450
    return this;
451
  }
452
 
571 rajveer 453
  public void unsetMobileNumber() {
454
    this.mobileNumber = null;
553 chandransh 455
  }
456
 
571 rajveer 457
  /** Returns true if field mobileNumber is set (has been asigned a value) and false otherwise */
458
  public boolean isSetMobileNumber() {
459
    return this.mobileNumber != null;
553 chandransh 460
  }
461
 
571 rajveer 462
  public void setMobileNumberIsSet(boolean value) {
553 chandransh 463
    if (!value) {
571 rajveer 464
      this.mobileNumber = null;
553 chandransh 465
    }
466
  }
467
 
468
  public SocialHandles getSocialHandles() {
469
    return this.socialHandles;
470
  }
471
 
472
  public User setSocialHandles(SocialHandles socialHandles) {
473
    this.socialHandles = socialHandles;
474
    return this;
475
  }
476
 
477
  public void unsetSocialHandles() {
478
    this.socialHandles = null;
479
  }
480
 
481
  /** Returns true if field socialHandles is set (has been asigned a value) and false otherwise */
482
  public boolean isSetSocialHandles() {
483
    return this.socialHandles != null;
484
  }
485
 
486
  public void setSocialHandlesIsSet(boolean value) {
487
    if (!value) {
488
      this.socialHandles = null;
489
    }
490
  }
491
 
492
  public int getAddressesSize() {
493
    return (this.addresses == null) ? 0 : this.addresses.size();
494
  }
495
 
496
  public java.util.Iterator<Address> getAddressesIterator() {
497
    return (this.addresses == null) ? null : this.addresses.iterator();
498
  }
499
 
500
  public void addToAddresses(Address elem) {
501
    if (this.addresses == null) {
502
      this.addresses = new ArrayList<Address>();
503
    }
504
    this.addresses.add(elem);
505
  }
506
 
507
  public List<Address> getAddresses() {
508
    return this.addresses;
509
  }
510
 
511
  public User setAddresses(List<Address> addresses) {
512
    this.addresses = addresses;
513
    return this;
514
  }
515
 
516
  public void unsetAddresses() {
517
    this.addresses = null;
518
  }
519
 
520
  /** Returns true if field addresses is set (has been asigned a value) and false otherwise */
521
  public boolean isSetAddresses() {
522
    return this.addresses != null;
523
  }
524
 
525
  public void setAddressesIsSet(boolean value) {
526
    if (!value) {
527
      this.addresses = null;
528
    }
529
  }
530
 
531
  public long getDefaultAddressId() {
532
    return this.defaultAddressId;
533
  }
534
 
535
  public User setDefaultAddressId(long defaultAddressId) {
536
    this.defaultAddressId = defaultAddressId;
537
    setDefaultAddressIdIsSet(true);
538
    return this;
539
  }
540
 
541
  public void unsetDefaultAddressId() {
542
    __isset_bit_vector.clear(__DEFAULTADDRESSID_ISSET_ID);
543
  }
544
 
545
  /** Returns true if field defaultAddressId is set (has been asigned a value) and false otherwise */
546
  public boolean isSetDefaultAddressId() {
547
    return __isset_bit_vector.get(__DEFAULTADDRESSID_ISSET_ID);
548
  }
549
 
550
  public void setDefaultAddressIdIsSet(boolean value) {
551
    __isset_bit_vector.set(__DEFAULTADDRESSID_ISSET_ID, value);
552
  }
553
 
554
  public String getCommunicationEmail() {
555
    return this.communicationEmail;
556
  }
557
 
558
  public User setCommunicationEmail(String communicationEmail) {
559
    this.communicationEmail = communicationEmail;
560
    return this;
561
  }
562
 
563
  public void unsetCommunicationEmail() {
564
    this.communicationEmail = null;
565
  }
566
 
567
  /** Returns true if field communicationEmail is set (has been asigned a value) and false otherwise */
568
  public boolean isSetCommunicationEmail() {
569
    return this.communicationEmail != null;
570
  }
571
 
572
  public void setCommunicationEmailIsSet(boolean value) {
573
    if (!value) {
574
      this.communicationEmail = null;
575
    }
576
  }
577
 
578
  public long getActiveCartId() {
579
    return this.activeCartId;
580
  }
581
 
582
  public User setActiveCartId(long activeCartId) {
583
    this.activeCartId = activeCartId;
584
    setActiveCartIdIsSet(true);
585
    return this;
586
  }
587
 
588
  public void unsetActiveCartId() {
589
    __isset_bit_vector.clear(__ACTIVECARTID_ISSET_ID);
590
  }
591
 
592
  /** Returns true if field activeCartId is set (has been asigned a value) and false otherwise */
593
  public boolean isSetActiveCartId() {
594
    return __isset_bit_vector.get(__ACTIVECARTID_ISSET_ID);
595
  }
596
 
597
  public void setActiveCartIdIsSet(boolean value) {
598
    __isset_bit_vector.set(__ACTIVECARTID_ISSET_ID, value);
599
  }
600
 
601
  public String getJsessionId() {
602
    return this.jsessionId;
603
  }
604
 
605
  public User setJsessionId(String jsessionId) {
606
    this.jsessionId = jsessionId;
607
    return this;
608
  }
609
 
610
  public void unsetJsessionId() {
611
    this.jsessionId = null;
612
  }
613
 
614
  /** Returns true if field jsessionId is set (has been asigned a value) and false otherwise */
615
  public boolean isSetJsessionId() {
616
    return this.jsessionId != null;
617
  }
618
 
619
  public void setJsessionIdIsSet(boolean value) {
620
    if (!value) {
621
      this.jsessionId = null;
622
    }
623
  }
624
 
625
  public boolean isIsAnonymous() {
626
    return this.isAnonymous;
627
  }
628
 
629
  public User setIsAnonymous(boolean isAnonymous) {
630
    this.isAnonymous = isAnonymous;
631
    setIsAnonymousIsSet(true);
632
    return this;
633
  }
634
 
635
  public void unsetIsAnonymous() {
636
    __isset_bit_vector.clear(__ISANONYMOUS_ISSET_ID);
637
  }
638
 
639
  /** Returns true if field isAnonymous is set (has been asigned a value) and false otherwise */
640
  public boolean isSetIsAnonymous() {
641
    return __isset_bit_vector.get(__ISANONYMOUS_ISSET_ID);
642
  }
643
 
644
  public void setIsAnonymousIsSet(boolean value) {
645
    __isset_bit_vector.set(__ISANONYMOUS_ISSET_ID, value);
646
  }
647
 
2020 vikas 648
  public String getSource() {
649
    return this.source;
650
  }
651
 
652
  public User setSource(String source) {
653
    this.source = source;
654
    return this;
655
  }
656
 
657
  public void unsetSource() {
658
    this.source = null;
659
  }
660
 
661
  /** Returns true if field source is set (has been asigned a value) and false otherwise */
662
  public boolean isSetSource() {
663
    return this.source != null;
664
  }
665
 
666
  public void setSourceIsSet(boolean value) {
667
    if (!value) {
668
      this.source = null;
669
    }
670
  }
671
 
2816 vikas 672
  public long getSourceStartTime() {
673
    return this.sourceStartTime;
674
  }
675
 
676
  public User setSourceStartTime(long sourceStartTime) {
677
    this.sourceStartTime = sourceStartTime;
678
    setSourceStartTimeIsSet(true);
679
    return this;
680
  }
681
 
682
  public void unsetSourceStartTime() {
683
    __isset_bit_vector.clear(__SOURCESTARTTIME_ISSET_ID);
684
  }
685
 
686
  /** Returns true if field sourceStartTime is set (has been asigned a value) and false otherwise */
687
  public boolean isSetSourceStartTime() {
688
    return __isset_bit_vector.get(__SOURCESTARTTIME_ISSET_ID);
689
  }
690
 
691
  public void setSourceStartTimeIsSet(boolean value) {
692
    __isset_bit_vector.set(__SOURCESTARTTIME_ISSET_ID, value);
693
  }
694
 
553 chandransh 695
  public void setFieldValue(_Fields field, Object value) {
696
    switch (field) {
697
    case USER_ID:
698
      if (value == null) {
699
        unsetUserId();
700
      } else {
701
        setUserId((Long)value);
702
      }
703
      break;
704
 
705
    case EMAIL:
706
      if (value == null) {
707
        unsetEmail();
708
      } else {
709
        setEmail((String)value);
710
      }
711
      break;
712
 
713
    case PASSWORD:
714
      if (value == null) {
715
        unsetPassword();
716
      } else {
717
        setPassword((String)value);
718
      }
719
      break;
720
 
721
    case NAME:
722
      if (value == null) {
723
        unsetName();
724
      } else {
725
        setName((String)value);
726
      }
727
      break;
728
 
729
    case DATE_OF_BIRTH:
730
      if (value == null) {
731
        unsetDateOfBirth();
732
      } else {
571 rajveer 733
        setDateOfBirth((String)value);
553 chandransh 734
      }
735
      break;
736
 
737
    case SEX:
738
      if (value == null) {
739
        unsetSex();
740
      } else {
741
        setSex((Sex)value);
742
      }
743
      break;
744
 
571 rajveer 745
    case MOBILE_NUMBER:
553 chandransh 746
      if (value == null) {
571 rajveer 747
        unsetMobileNumber();
553 chandransh 748
      } else {
571 rajveer 749
        setMobileNumber((String)value);
553 chandransh 750
      }
751
      break;
752
 
753
    case SOCIAL_HANDLES:
754
      if (value == null) {
755
        unsetSocialHandles();
756
      } else {
757
        setSocialHandles((SocialHandles)value);
758
      }
759
      break;
760
 
761
    case ADDRESSES:
762
      if (value == null) {
763
        unsetAddresses();
764
      } else {
765
        setAddresses((List<Address>)value);
766
      }
767
      break;
768
 
769
    case DEFAULT_ADDRESS_ID:
770
      if (value == null) {
771
        unsetDefaultAddressId();
772
      } else {
773
        setDefaultAddressId((Long)value);
774
      }
775
      break;
776
 
777
    case COMMUNICATION_EMAIL:
778
      if (value == null) {
779
        unsetCommunicationEmail();
780
      } else {
781
        setCommunicationEmail((String)value);
782
      }
783
      break;
784
 
785
    case ACTIVE_CART_ID:
786
      if (value == null) {
787
        unsetActiveCartId();
788
      } else {
789
        setActiveCartId((Long)value);
790
      }
791
      break;
792
 
793
    case JSESSION_ID:
794
      if (value == null) {
795
        unsetJsessionId();
796
      } else {
797
        setJsessionId((String)value);
798
      }
799
      break;
800
 
801
    case IS_ANONYMOUS:
802
      if (value == null) {
803
        unsetIsAnonymous();
804
      } else {
805
        setIsAnonymous((Boolean)value);
806
      }
807
      break;
808
 
2020 vikas 809
    case SOURCE:
810
      if (value == null) {
811
        unsetSource();
812
      } else {
813
        setSource((String)value);
814
      }
815
      break;
816
 
2816 vikas 817
    case SOURCE_START_TIME:
818
      if (value == null) {
819
        unsetSourceStartTime();
820
      } else {
821
        setSourceStartTime((Long)value);
822
      }
823
      break;
824
 
553 chandransh 825
    }
826
  }
827
 
828
  public void setFieldValue(int fieldID, Object value) {
829
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
830
  }
831
 
832
  public Object getFieldValue(_Fields field) {
833
    switch (field) {
834
    case USER_ID:
835
      return new Long(getUserId());
836
 
837
    case EMAIL:
838
      return getEmail();
839
 
840
    case PASSWORD:
841
      return getPassword();
842
 
843
    case NAME:
844
      return getName();
845
 
846
    case DATE_OF_BIRTH:
571 rajveer 847
      return getDateOfBirth();
553 chandransh 848
 
849
    case SEX:
850
      return getSex();
851
 
571 rajveer 852
    case MOBILE_NUMBER:
853
      return getMobileNumber();
553 chandransh 854
 
855
    case SOCIAL_HANDLES:
856
      return getSocialHandles();
857
 
858
    case ADDRESSES:
859
      return getAddresses();
860
 
861
    case DEFAULT_ADDRESS_ID:
862
      return new Long(getDefaultAddressId());
863
 
864
    case COMMUNICATION_EMAIL:
865
      return getCommunicationEmail();
866
 
867
    case ACTIVE_CART_ID:
868
      return new Long(getActiveCartId());
869
 
870
    case JSESSION_ID:
871
      return getJsessionId();
872
 
873
    case IS_ANONYMOUS:
874
      return new Boolean(isIsAnonymous());
875
 
2020 vikas 876
    case SOURCE:
877
      return getSource();
878
 
2816 vikas 879
    case SOURCE_START_TIME:
880
      return new Long(getSourceStartTime());
881
 
553 chandransh 882
    }
883
    throw new IllegalStateException();
884
  }
885
 
886
  public Object getFieldValue(int fieldId) {
887
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
888
  }
889
 
890
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
891
  public boolean isSet(_Fields field) {
892
    switch (field) {
893
    case USER_ID:
894
      return isSetUserId();
895
    case EMAIL:
896
      return isSetEmail();
897
    case PASSWORD:
898
      return isSetPassword();
899
    case NAME:
900
      return isSetName();
901
    case DATE_OF_BIRTH:
902
      return isSetDateOfBirth();
903
    case SEX:
904
      return isSetSex();
571 rajveer 905
    case MOBILE_NUMBER:
906
      return isSetMobileNumber();
553 chandransh 907
    case SOCIAL_HANDLES:
908
      return isSetSocialHandles();
909
    case ADDRESSES:
910
      return isSetAddresses();
911
    case DEFAULT_ADDRESS_ID:
912
      return isSetDefaultAddressId();
913
    case COMMUNICATION_EMAIL:
914
      return isSetCommunicationEmail();
915
    case ACTIVE_CART_ID:
916
      return isSetActiveCartId();
917
    case JSESSION_ID:
918
      return isSetJsessionId();
919
    case IS_ANONYMOUS:
920
      return isSetIsAnonymous();
2020 vikas 921
    case SOURCE:
922
      return isSetSource();
2816 vikas 923
    case SOURCE_START_TIME:
924
      return isSetSourceStartTime();
553 chandransh 925
    }
926
    throw new IllegalStateException();
927
  }
928
 
929
  public boolean isSet(int fieldID) {
930
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
931
  }
932
 
933
  @Override
934
  public boolean equals(Object that) {
935
    if (that == null)
936
      return false;
937
    if (that instanceof User)
938
      return this.equals((User)that);
939
    return false;
940
  }
941
 
942
  public boolean equals(User that) {
943
    if (that == null)
944
      return false;
945
 
946
    boolean this_present_userId = true;
947
    boolean that_present_userId = true;
948
    if (this_present_userId || that_present_userId) {
949
      if (!(this_present_userId && that_present_userId))
950
        return false;
951
      if (this.userId != that.userId)
952
        return false;
953
    }
954
 
955
    boolean this_present_email = true && this.isSetEmail();
956
    boolean that_present_email = true && that.isSetEmail();
957
    if (this_present_email || that_present_email) {
958
      if (!(this_present_email && that_present_email))
959
        return false;
960
      if (!this.email.equals(that.email))
961
        return false;
962
    }
963
 
964
    boolean this_present_password = true && this.isSetPassword();
965
    boolean that_present_password = true && that.isSetPassword();
966
    if (this_present_password || that_present_password) {
967
      if (!(this_present_password && that_present_password))
968
        return false;
969
      if (!this.password.equals(that.password))
970
        return false;
971
    }
972
 
973
    boolean this_present_name = true && this.isSetName();
974
    boolean that_present_name = true && that.isSetName();
975
    if (this_present_name || that_present_name) {
976
      if (!(this_present_name && that_present_name))
977
        return false;
978
      if (!this.name.equals(that.name))
979
        return false;
980
    }
981
 
571 rajveer 982
    boolean this_present_dateOfBirth = true && this.isSetDateOfBirth();
983
    boolean that_present_dateOfBirth = true && that.isSetDateOfBirth();
553 chandransh 984
    if (this_present_dateOfBirth || that_present_dateOfBirth) {
985
      if (!(this_present_dateOfBirth && that_present_dateOfBirth))
986
        return false;
571 rajveer 987
      if (!this.dateOfBirth.equals(that.dateOfBirth))
553 chandransh 988
        return false;
989
    }
990
 
991
    boolean this_present_sex = true && this.isSetSex();
992
    boolean that_present_sex = true && that.isSetSex();
993
    if (this_present_sex || that_present_sex) {
994
      if (!(this_present_sex && that_present_sex))
995
        return false;
996
      if (!this.sex.equals(that.sex))
997
        return false;
998
    }
999
 
571 rajveer 1000
    boolean this_present_mobileNumber = true && this.isSetMobileNumber();
1001
    boolean that_present_mobileNumber = true && that.isSetMobileNumber();
1002
    if (this_present_mobileNumber || that_present_mobileNumber) {
1003
      if (!(this_present_mobileNumber && that_present_mobileNumber))
553 chandransh 1004
        return false;
571 rajveer 1005
      if (!this.mobileNumber.equals(that.mobileNumber))
553 chandransh 1006
        return false;
1007
    }
1008
 
1009
    boolean this_present_socialHandles = true && this.isSetSocialHandles();
1010
    boolean that_present_socialHandles = true && that.isSetSocialHandles();
1011
    if (this_present_socialHandles || that_present_socialHandles) {
1012
      if (!(this_present_socialHandles && that_present_socialHandles))
1013
        return false;
1014
      if (!this.socialHandles.equals(that.socialHandles))
1015
        return false;
1016
    }
1017
 
1018
    boolean this_present_addresses = true && this.isSetAddresses();
1019
    boolean that_present_addresses = true && that.isSetAddresses();
1020
    if (this_present_addresses || that_present_addresses) {
1021
      if (!(this_present_addresses && that_present_addresses))
1022
        return false;
1023
      if (!this.addresses.equals(that.addresses))
1024
        return false;
1025
    }
1026
 
1027
    boolean this_present_defaultAddressId = true;
1028
    boolean that_present_defaultAddressId = true;
1029
    if (this_present_defaultAddressId || that_present_defaultAddressId) {
1030
      if (!(this_present_defaultAddressId && that_present_defaultAddressId))
1031
        return false;
1032
      if (this.defaultAddressId != that.defaultAddressId)
1033
        return false;
1034
    }
1035
 
1036
    boolean this_present_communicationEmail = true && this.isSetCommunicationEmail();
1037
    boolean that_present_communicationEmail = true && that.isSetCommunicationEmail();
1038
    if (this_present_communicationEmail || that_present_communicationEmail) {
1039
      if (!(this_present_communicationEmail && that_present_communicationEmail))
1040
        return false;
1041
      if (!this.communicationEmail.equals(that.communicationEmail))
1042
        return false;
1043
    }
1044
 
1045
    boolean this_present_activeCartId = true;
1046
    boolean that_present_activeCartId = true;
1047
    if (this_present_activeCartId || that_present_activeCartId) {
1048
      if (!(this_present_activeCartId && that_present_activeCartId))
1049
        return false;
1050
      if (this.activeCartId != that.activeCartId)
1051
        return false;
1052
    }
1053
 
1054
    boolean this_present_jsessionId = true && this.isSetJsessionId();
1055
    boolean that_present_jsessionId = true && that.isSetJsessionId();
1056
    if (this_present_jsessionId || that_present_jsessionId) {
1057
      if (!(this_present_jsessionId && that_present_jsessionId))
1058
        return false;
1059
      if (!this.jsessionId.equals(that.jsessionId))
1060
        return false;
1061
    }
1062
 
1063
    boolean this_present_isAnonymous = true;
1064
    boolean that_present_isAnonymous = true;
1065
    if (this_present_isAnonymous || that_present_isAnonymous) {
1066
      if (!(this_present_isAnonymous && that_present_isAnonymous))
1067
        return false;
1068
      if (this.isAnonymous != that.isAnonymous)
1069
        return false;
1070
    }
1071
 
2020 vikas 1072
    boolean this_present_source = true && this.isSetSource();
1073
    boolean that_present_source = true && that.isSetSource();
1074
    if (this_present_source || that_present_source) {
1075
      if (!(this_present_source && that_present_source))
1076
        return false;
1077
      if (!this.source.equals(that.source))
1078
        return false;
1079
    }
1080
 
2816 vikas 1081
    boolean this_present_sourceStartTime = true;
1082
    boolean that_present_sourceStartTime = true;
1083
    if (this_present_sourceStartTime || that_present_sourceStartTime) {
1084
      if (!(this_present_sourceStartTime && that_present_sourceStartTime))
1085
        return false;
1086
      if (this.sourceStartTime != that.sourceStartTime)
1087
        return false;
1088
    }
1089
 
553 chandransh 1090
    return true;
1091
  }
1092
 
1093
  @Override
1094
  public int hashCode() {
1095
    return 0;
1096
  }
1097
 
571 rajveer 1098
  public int compareTo(User other) {
1099
    if (!getClass().equals(other.getClass())) {
1100
      return getClass().getName().compareTo(other.getClass().getName());
1101
    }
1102
 
1103
    int lastComparison = 0;
1104
    User typedOther = (User)other;
1105
 
1106
    lastComparison = Boolean.valueOf(isSetUserId()).compareTo(isSetUserId());
1107
    if (lastComparison != 0) {
1108
      return lastComparison;
1109
    }
1110
    lastComparison = TBaseHelper.compareTo(userId, typedOther.userId);
1111
    if (lastComparison != 0) {
1112
      return lastComparison;
1113
    }
1114
    lastComparison = Boolean.valueOf(isSetEmail()).compareTo(isSetEmail());
1115
    if (lastComparison != 0) {
1116
      return lastComparison;
1117
    }
1118
    lastComparison = TBaseHelper.compareTo(email, typedOther.email);
1119
    if (lastComparison != 0) {
1120
      return lastComparison;
1121
    }
1122
    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(isSetPassword());
1123
    if (lastComparison != 0) {
1124
      return lastComparison;
1125
    }
1126
    lastComparison = TBaseHelper.compareTo(password, typedOther.password);
1127
    if (lastComparison != 0) {
1128
      return lastComparison;
1129
    }
1130
    lastComparison = Boolean.valueOf(isSetName()).compareTo(isSetName());
1131
    if (lastComparison != 0) {
1132
      return lastComparison;
1133
    }
1134
    lastComparison = TBaseHelper.compareTo(name, typedOther.name);
1135
    if (lastComparison != 0) {
1136
      return lastComparison;
1137
    }
1138
    lastComparison = Boolean.valueOf(isSetDateOfBirth()).compareTo(isSetDateOfBirth());
1139
    if (lastComparison != 0) {
1140
      return lastComparison;
1141
    }
1142
    lastComparison = TBaseHelper.compareTo(dateOfBirth, typedOther.dateOfBirth);
1143
    if (lastComparison != 0) {
1144
      return lastComparison;
1145
    }
1146
    lastComparison = Boolean.valueOf(isSetSex()).compareTo(isSetSex());
1147
    if (lastComparison != 0) {
1148
      return lastComparison;
1149
    }
1150
    lastComparison = TBaseHelper.compareTo(sex, typedOther.sex);
1151
    if (lastComparison != 0) {
1152
      return lastComparison;
1153
    }
1154
    lastComparison = Boolean.valueOf(isSetMobileNumber()).compareTo(isSetMobileNumber());
1155
    if (lastComparison != 0) {
1156
      return lastComparison;
1157
    }
1158
    lastComparison = TBaseHelper.compareTo(mobileNumber, typedOther.mobileNumber);
1159
    if (lastComparison != 0) {
1160
      return lastComparison;
1161
    }
1162
    lastComparison = Boolean.valueOf(isSetSocialHandles()).compareTo(isSetSocialHandles());
1163
    if (lastComparison != 0) {
1164
      return lastComparison;
1165
    }
1166
    lastComparison = TBaseHelper.compareTo(socialHandles, typedOther.socialHandles);
1167
    if (lastComparison != 0) {
1168
      return lastComparison;
1169
    }
1170
    lastComparison = Boolean.valueOf(isSetAddresses()).compareTo(isSetAddresses());
1171
    if (lastComparison != 0) {
1172
      return lastComparison;
1173
    }
1174
    lastComparison = TBaseHelper.compareTo(addresses, typedOther.addresses);
1175
    if (lastComparison != 0) {
1176
      return lastComparison;
1177
    }
1178
    lastComparison = Boolean.valueOf(isSetDefaultAddressId()).compareTo(isSetDefaultAddressId());
1179
    if (lastComparison != 0) {
1180
      return lastComparison;
1181
    }
1182
    lastComparison = TBaseHelper.compareTo(defaultAddressId, typedOther.defaultAddressId);
1183
    if (lastComparison != 0) {
1184
      return lastComparison;
1185
    }
1186
    lastComparison = Boolean.valueOf(isSetCommunicationEmail()).compareTo(isSetCommunicationEmail());
1187
    if (lastComparison != 0) {
1188
      return lastComparison;
1189
    }
1190
    lastComparison = TBaseHelper.compareTo(communicationEmail, typedOther.communicationEmail);
1191
    if (lastComparison != 0) {
1192
      return lastComparison;
1193
    }
1194
    lastComparison = Boolean.valueOf(isSetActiveCartId()).compareTo(isSetActiveCartId());
1195
    if (lastComparison != 0) {
1196
      return lastComparison;
1197
    }
1198
    lastComparison = TBaseHelper.compareTo(activeCartId, typedOther.activeCartId);
1199
    if (lastComparison != 0) {
1200
      return lastComparison;
1201
    }
1202
    lastComparison = Boolean.valueOf(isSetJsessionId()).compareTo(isSetJsessionId());
1203
    if (lastComparison != 0) {
1204
      return lastComparison;
1205
    }
1206
    lastComparison = TBaseHelper.compareTo(jsessionId, typedOther.jsessionId);
1207
    if (lastComparison != 0) {
1208
      return lastComparison;
1209
    }
1210
    lastComparison = Boolean.valueOf(isSetIsAnonymous()).compareTo(isSetIsAnonymous());
1211
    if (lastComparison != 0) {
1212
      return lastComparison;
1213
    }
1214
    lastComparison = TBaseHelper.compareTo(isAnonymous, typedOther.isAnonymous);
1215
    if (lastComparison != 0) {
1216
      return lastComparison;
1217
    }
2020 vikas 1218
    lastComparison = Boolean.valueOf(isSetSource()).compareTo(isSetSource());
1219
    if (lastComparison != 0) {
1220
      return lastComparison;
1221
    }
1222
    lastComparison = TBaseHelper.compareTo(source, typedOther.source);
1223
    if (lastComparison != 0) {
1224
      return lastComparison;
1225
    }
2816 vikas 1226
    lastComparison = Boolean.valueOf(isSetSourceStartTime()).compareTo(isSetSourceStartTime());
1227
    if (lastComparison != 0) {
1228
      return lastComparison;
1229
    }
1230
    lastComparison = TBaseHelper.compareTo(sourceStartTime, typedOther.sourceStartTime);
1231
    if (lastComparison != 0) {
1232
      return lastComparison;
1233
    }
571 rajveer 1234
    return 0;
1235
  }
1236
 
553 chandransh 1237
  public void read(TProtocol iprot) throws TException {
1238
    TField field;
1239
    iprot.readStructBegin();
1240
    while (true)
1241
    {
1242
      field = iprot.readFieldBegin();
1243
      if (field.type == TType.STOP) { 
1244
        break;
1245
      }
1246
      _Fields fieldId = _Fields.findByThriftId(field.id);
1247
      if (fieldId == null) {
1248
        TProtocolUtil.skip(iprot, field.type);
1249
      } else {
1250
        switch (fieldId) {
1251
          case USER_ID:
1252
            if (field.type == TType.I64) {
1253
              this.userId = iprot.readI64();
1254
              setUserIdIsSet(true);
1255
            } else { 
1256
              TProtocolUtil.skip(iprot, field.type);
1257
            }
1258
            break;
1259
          case EMAIL:
1260
            if (field.type == TType.STRING) {
1261
              this.email = iprot.readString();
1262
            } else { 
1263
              TProtocolUtil.skip(iprot, field.type);
1264
            }
1265
            break;
1266
          case PASSWORD:
1267
            if (field.type == TType.STRING) {
1268
              this.password = iprot.readString();
1269
            } else { 
1270
              TProtocolUtil.skip(iprot, field.type);
1271
            }
1272
            break;
1273
          case NAME:
1274
            if (field.type == TType.STRING) {
1275
              this.name = iprot.readString();
1276
            } else { 
1277
              TProtocolUtil.skip(iprot, field.type);
1278
            }
1279
            break;
1280
          case DATE_OF_BIRTH:
571 rajveer 1281
            if (field.type == TType.STRING) {
1282
              this.dateOfBirth = iprot.readString();
553 chandransh 1283
            } else { 
1284
              TProtocolUtil.skip(iprot, field.type);
1285
            }
1286
            break;
1287
          case SEX:
1288
            if (field.type == TType.I32) {
1289
              this.sex = Sex.findByValue(iprot.readI32());
1290
            } else { 
1291
              TProtocolUtil.skip(iprot, field.type);
1292
            }
1293
            break;
571 rajveer 1294
          case MOBILE_NUMBER:
1295
            if (field.type == TType.STRING) {
1296
              this.mobileNumber = iprot.readString();
553 chandransh 1297
            } else { 
1298
              TProtocolUtil.skip(iprot, field.type);
1299
            }
1300
            break;
1301
          case SOCIAL_HANDLES:
1302
            if (field.type == TType.STRUCT) {
1303
              this.socialHandles = new SocialHandles();
1304
              this.socialHandles.read(iprot);
1305
            } else { 
1306
              TProtocolUtil.skip(iprot, field.type);
1307
            }
1308
            break;
1309
          case ADDRESSES:
1310
            if (field.type == TType.LIST) {
1311
              {
571 rajveer 1312
                TList _list4 = iprot.readListBegin();
1313
                this.addresses = new ArrayList<Address>(_list4.size);
1314
                for (int _i5 = 0; _i5 < _list4.size; ++_i5)
553 chandransh 1315
                {
571 rajveer 1316
                  Address _elem6;
1317
                  _elem6 = new Address();
1318
                  _elem6.read(iprot);
1319
                  this.addresses.add(_elem6);
553 chandransh 1320
                }
1321
                iprot.readListEnd();
1322
              }
1323
            } else { 
1324
              TProtocolUtil.skip(iprot, field.type);
1325
            }
1326
            break;
1327
          case DEFAULT_ADDRESS_ID:
1328
            if (field.type == TType.I64) {
1329
              this.defaultAddressId = iprot.readI64();
1330
              setDefaultAddressIdIsSet(true);
1331
            } else { 
1332
              TProtocolUtil.skip(iprot, field.type);
1333
            }
1334
            break;
1335
          case COMMUNICATION_EMAIL:
1336
            if (field.type == TType.STRING) {
1337
              this.communicationEmail = iprot.readString();
1338
            } else { 
1339
              TProtocolUtil.skip(iprot, field.type);
1340
            }
1341
            break;
1342
          case ACTIVE_CART_ID:
1343
            if (field.type == TType.I64) {
1344
              this.activeCartId = iprot.readI64();
1345
              setActiveCartIdIsSet(true);
1346
            } else { 
1347
              TProtocolUtil.skip(iprot, field.type);
1348
            }
1349
            break;
1350
          case JSESSION_ID:
1351
            if (field.type == TType.STRING) {
1352
              this.jsessionId = iprot.readString();
1353
            } else { 
1354
              TProtocolUtil.skip(iprot, field.type);
1355
            }
1356
            break;
1357
          case IS_ANONYMOUS:
1358
            if (field.type == TType.BOOL) {
1359
              this.isAnonymous = iprot.readBool();
1360
              setIsAnonymousIsSet(true);
1361
            } else { 
1362
              TProtocolUtil.skip(iprot, field.type);
1363
            }
1364
            break;
2020 vikas 1365
          case SOURCE:
1366
            if (field.type == TType.STRING) {
1367
              this.source = iprot.readString();
1368
            } else { 
1369
              TProtocolUtil.skip(iprot, field.type);
1370
            }
1371
            break;
2816 vikas 1372
          case SOURCE_START_TIME:
1373
            if (field.type == TType.I64) {
1374
              this.sourceStartTime = iprot.readI64();
1375
              setSourceStartTimeIsSet(true);
1376
            } else { 
1377
              TProtocolUtil.skip(iprot, field.type);
1378
            }
1379
            break;
553 chandransh 1380
        }
1381
        iprot.readFieldEnd();
1382
      }
1383
    }
1384
    iprot.readStructEnd();
1385
    validate();
1386
  }
1387
 
1388
  public void write(TProtocol oprot) throws TException {
1389
    validate();
1390
 
1391
    oprot.writeStructBegin(STRUCT_DESC);
1392
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
1393
    oprot.writeI64(this.userId);
1394
    oprot.writeFieldEnd();
1395
    if (this.email != null) {
1396
      oprot.writeFieldBegin(EMAIL_FIELD_DESC);
1397
      oprot.writeString(this.email);
1398
      oprot.writeFieldEnd();
1399
    }
1400
    if (this.password != null) {
1401
      oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
1402
      oprot.writeString(this.password);
1403
      oprot.writeFieldEnd();
1404
    }
1405
    if (this.name != null) {
1406
      oprot.writeFieldBegin(NAME_FIELD_DESC);
1407
      oprot.writeString(this.name);
1408
      oprot.writeFieldEnd();
1409
    }
571 rajveer 1410
    if (this.dateOfBirth != null) {
1411
      oprot.writeFieldBegin(DATE_OF_BIRTH_FIELD_DESC);
1412
      oprot.writeString(this.dateOfBirth);
1413
      oprot.writeFieldEnd();
1414
    }
553 chandransh 1415
    if (this.sex != null) {
1416
      oprot.writeFieldBegin(SEX_FIELD_DESC);
1417
      oprot.writeI32(this.sex.getValue());
1418
      oprot.writeFieldEnd();
1419
    }
571 rajveer 1420
    if (this.mobileNumber != null) {
1421
      oprot.writeFieldBegin(MOBILE_NUMBER_FIELD_DESC);
1422
      oprot.writeString(this.mobileNumber);
553 chandransh 1423
      oprot.writeFieldEnd();
1424
    }
1425
    if (this.socialHandles != null) {
1426
      oprot.writeFieldBegin(SOCIAL_HANDLES_FIELD_DESC);
1427
      this.socialHandles.write(oprot);
1428
      oprot.writeFieldEnd();
1429
    }
1430
    if (this.addresses != null) {
1431
      oprot.writeFieldBegin(ADDRESSES_FIELD_DESC);
1432
      {
1433
        oprot.writeListBegin(new TList(TType.STRUCT, this.addresses.size()));
571 rajveer 1434
        for (Address _iter7 : this.addresses)
553 chandransh 1435
        {
571 rajveer 1436
          _iter7.write(oprot);
553 chandransh 1437
        }
1438
        oprot.writeListEnd();
1439
      }
1440
      oprot.writeFieldEnd();
1441
    }
1442
    oprot.writeFieldBegin(DEFAULT_ADDRESS_ID_FIELD_DESC);
1443
    oprot.writeI64(this.defaultAddressId);
1444
    oprot.writeFieldEnd();
1445
    if (this.communicationEmail != null) {
1446
      oprot.writeFieldBegin(COMMUNICATION_EMAIL_FIELD_DESC);
1447
      oprot.writeString(this.communicationEmail);
1448
      oprot.writeFieldEnd();
1449
    }
1450
    oprot.writeFieldBegin(ACTIVE_CART_ID_FIELD_DESC);
1451
    oprot.writeI64(this.activeCartId);
1452
    oprot.writeFieldEnd();
1453
    if (this.jsessionId != null) {
1454
      oprot.writeFieldBegin(JSESSION_ID_FIELD_DESC);
1455
      oprot.writeString(this.jsessionId);
1456
      oprot.writeFieldEnd();
1457
    }
1458
    oprot.writeFieldBegin(IS_ANONYMOUS_FIELD_DESC);
1459
    oprot.writeBool(this.isAnonymous);
1460
    oprot.writeFieldEnd();
2020 vikas 1461
    if (this.source != null) {
1462
      oprot.writeFieldBegin(SOURCE_FIELD_DESC);
1463
      oprot.writeString(this.source);
1464
      oprot.writeFieldEnd();
1465
    }
2816 vikas 1466
    oprot.writeFieldBegin(SOURCE_START_TIME_FIELD_DESC);
1467
    oprot.writeI64(this.sourceStartTime);
1468
    oprot.writeFieldEnd();
553 chandransh 1469
    oprot.writeFieldStop();
1470
    oprot.writeStructEnd();
1471
  }
1472
 
1473
  @Override
1474
  public String toString() {
1475
    StringBuilder sb = new StringBuilder("User(");
1476
    boolean first = true;
1477
 
1478
    sb.append("userId:");
1479
    sb.append(this.userId);
1480
    first = false;
1481
    if (!first) sb.append(", ");
1482
    sb.append("email:");
1483
    if (this.email == null) {
1484
      sb.append("null");
1485
    } else {
1486
      sb.append(this.email);
1487
    }
1488
    first = false;
1489
    if (!first) sb.append(", ");
1490
    sb.append("password:");
1491
    if (this.password == null) {
1492
      sb.append("null");
1493
    } else {
1494
      sb.append(this.password);
1495
    }
1496
    first = false;
1497
    if (!first) sb.append(", ");
1498
    sb.append("name:");
1499
    if (this.name == null) {
1500
      sb.append("null");
1501
    } else {
1502
      sb.append(this.name);
1503
    }
1504
    first = false;
1505
    if (!first) sb.append(", ");
1506
    sb.append("dateOfBirth:");
571 rajveer 1507
    if (this.dateOfBirth == null) {
1508
      sb.append("null");
1509
    } else {
1510
      sb.append(this.dateOfBirth);
1511
    }
553 chandransh 1512
    first = false;
1513
    if (!first) sb.append(", ");
1514
    sb.append("sex:");
1515
    if (this.sex == null) {
1516
      sb.append("null");
1517
    } else {
1518
      String sex_name = sex.name();
1519
      if (sex_name != null) {
1520
        sb.append(sex_name);
1521
        sb.append(" (");
1522
      }
1523
      sb.append(this.sex);
1524
      if (sex_name != null) {
1525
        sb.append(")");
1526
      }
1527
    }
1528
    first = false;
1529
    if (!first) sb.append(", ");
571 rajveer 1530
    sb.append("mobileNumber:");
1531
    if (this.mobileNumber == null) {
553 chandransh 1532
      sb.append("null");
1533
    } else {
571 rajveer 1534
      sb.append(this.mobileNumber);
553 chandransh 1535
    }
1536
    first = false;
1537
    if (!first) sb.append(", ");
1538
    sb.append("socialHandles:");
1539
    if (this.socialHandles == null) {
1540
      sb.append("null");
1541
    } else {
1542
      sb.append(this.socialHandles);
1543
    }
1544
    first = false;
1545
    if (!first) sb.append(", ");
1546
    sb.append("addresses:");
1547
    if (this.addresses == null) {
1548
      sb.append("null");
1549
    } else {
1550
      sb.append(this.addresses);
1551
    }
1552
    first = false;
1553
    if (!first) sb.append(", ");
1554
    sb.append("defaultAddressId:");
1555
    sb.append(this.defaultAddressId);
1556
    first = false;
1557
    if (!first) sb.append(", ");
1558
    sb.append("communicationEmail:");
1559
    if (this.communicationEmail == null) {
1560
      sb.append("null");
1561
    } else {
1562
      sb.append(this.communicationEmail);
1563
    }
1564
    first = false;
1565
    if (!first) sb.append(", ");
1566
    sb.append("activeCartId:");
1567
    sb.append(this.activeCartId);
1568
    first = false;
1569
    if (!first) sb.append(", ");
1570
    sb.append("jsessionId:");
1571
    if (this.jsessionId == null) {
1572
      sb.append("null");
1573
    } else {
1574
      sb.append(this.jsessionId);
1575
    }
1576
    first = false;
1577
    if (!first) sb.append(", ");
1578
    sb.append("isAnonymous:");
1579
    sb.append(this.isAnonymous);
1580
    first = false;
2020 vikas 1581
    if (!first) sb.append(", ");
1582
    sb.append("source:");
1583
    if (this.source == null) {
1584
      sb.append("null");
1585
    } else {
1586
      sb.append(this.source);
1587
    }
1588
    first = false;
2816 vikas 1589
    if (!first) sb.append(", ");
1590
    sb.append("sourceStartTime:");
1591
    sb.append(this.sourceStartTime);
1592
    first = false;
553 chandransh 1593
    sb.append(")");
1594
    return sb.toString();
1595
  }
1596
 
1597
  public void validate() throws TException {
1598
    // check for required fields
1599
  }
1600
 
1601
}
1602