Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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