Subversion Repositories SmartDukaan

Rev

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