Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
48 ashish 1
/**
2
 * Autogenerated by Thrift
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
 
22
import org.apache.thrift.*;
23
import org.apache.thrift.meta_data.*;
24
import org.apache.thrift.protocol.*;
25
 
26
public class TAddress implements TBase<TAddress._Fields>, java.io.Serializable, Cloneable, Comparable<TAddress> {
27
  private static final TStruct STRUCT_DESC = new TStruct("TAddress");
28
 
29
  private static final TField LINE1_FIELD_DESC = new TField("line1", TType.STRING, (short)1);
30
  private static final TField LINE2_FIELD_DESC = new TField("line2", TType.STRING, (short)2);
31
  private static final TField LANDMARK_FIELD_DESC = new TField("landmark", TType.STRING, (short)3);
32
  private static final TField CITY_FIELD_DESC = new TField("city", TType.STRING, (short)4);
33
  private static final TField STATE_FIELD_DESC = new TField("state", TType.STRING, (short)5);
34
  private static final TField PIN_FIELD_DESC = new TField("pin", TType.STRING, (short)6);
35
  private static final TField COUNTRY_FIELD_DESC = new TField("country", TType.STRING, (short)7);
36
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)8);
37
  private static final TField ENABLED_FIELD_DESC = new TField("enabled", TType.BOOL, (short)9);
38
  private static final TField TYPE_FIELD_DESC = new TField("type", TType.I32, (short)10);
39
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)11);
40
 
41
  private String line1;
42
  private String line2;
43
  private String landmark;
44
  private String city;
45
  private String state;
46
  private String pin;
47
  private String country;
48
  private long id;
49
  private boolean enabled;
50
  private TAddressType type;
51
  private long addedOn;
52
 
53
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
54
  public enum _Fields implements TFieldIdEnum {
55
    LINE1((short)1, "line1"),
56
    LINE2((short)2, "line2"),
57
    LANDMARK((short)3, "landmark"),
58
    CITY((short)4, "city"),
59
    STATE((short)5, "state"),
60
    PIN((short)6, "pin"),
61
    COUNTRY((short)7, "country"),
62
    ID((short)8, "id"),
63
    ENABLED((short)9, "enabled"),
64
    /**
65
     * 
66
     * @see TAddressType
67
     */
68
    TYPE((short)10, "type"),
69
    ADDED_ON((short)11, "addedOn");
70
 
71
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
72
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
73
 
74
    static {
75
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
76
        byId.put((int)field._thriftId, field);
77
        byName.put(field.getFieldName(), field);
78
      }
79
    }
80
 
81
    /**
82
     * Find the _Fields constant that matches fieldId, or null if its not found.
83
     */
84
    public static _Fields findByThriftId(int fieldId) {
85
      return byId.get(fieldId);
86
    }
87
 
88
    /**
89
     * Find the _Fields constant that matches fieldId, throwing an exception
90
     * if it is not found.
91
     */
92
    public static _Fields findByThriftIdOrThrow(int fieldId) {
93
      _Fields fields = findByThriftId(fieldId);
94
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
95
      return fields;
96
    }
97
 
98
    /**
99
     * Find the _Fields constant that matches name, or null if its not found.
100
     */
101
    public static _Fields findByName(String name) {
102
      return byName.get(name);
103
    }
104
 
105
    private final short _thriftId;
106
    private final String _fieldName;
107
 
108
    _Fields(short thriftId, String fieldName) {
109
      _thriftId = thriftId;
110
      _fieldName = fieldName;
111
    }
112
 
113
    public short getThriftFieldId() {
114
      return _thriftId;
115
    }
116
 
117
    public String getFieldName() {
118
      return _fieldName;
119
    }
120
  }
121
 
122
  // isset id assignments
123
  private static final int __ID_ISSET_ID = 0;
124
  private static final int __ENABLED_ISSET_ID = 1;
125
  private static final int __ADDEDON_ISSET_ID = 2;
126
  private BitSet __isset_bit_vector = new BitSet(3);
127
 
128
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
129
    put(_Fields.LINE1, new FieldMetaData("line1", TFieldRequirementType.DEFAULT, 
130
        new FieldValueMetaData(TType.STRING)));
131
    put(_Fields.LINE2, new FieldMetaData("line2", TFieldRequirementType.DEFAULT, 
132
        new FieldValueMetaData(TType.STRING)));
133
    put(_Fields.LANDMARK, new FieldMetaData("landmark", TFieldRequirementType.DEFAULT, 
134
        new FieldValueMetaData(TType.STRING)));
135
    put(_Fields.CITY, new FieldMetaData("city", TFieldRequirementType.DEFAULT, 
136
        new FieldValueMetaData(TType.STRING)));
137
    put(_Fields.STATE, new FieldMetaData("state", TFieldRequirementType.DEFAULT, 
138
        new FieldValueMetaData(TType.STRING)));
139
    put(_Fields.PIN, new FieldMetaData("pin", TFieldRequirementType.DEFAULT, 
140
        new FieldValueMetaData(TType.STRING)));
141
    put(_Fields.COUNTRY, new FieldMetaData("country", TFieldRequirementType.DEFAULT, 
142
        new FieldValueMetaData(TType.STRING)));
143
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
144
        new FieldValueMetaData(TType.I64)));
145
    put(_Fields.ENABLED, new FieldMetaData("enabled", TFieldRequirementType.DEFAULT, 
146
        new FieldValueMetaData(TType.BOOL)));
147
    put(_Fields.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, 
148
        new EnumMetaData(TType.ENUM, TAddressType.class)));
149
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
150
        new FieldValueMetaData(TType.I64)));
151
  }});
152
 
153
  static {
154
    FieldMetaData.addStructMetaDataMap(TAddress.class, metaDataMap);
155
  }
156
 
157
  public TAddress() {
158
  }
159
 
160
  public TAddress(
161
    String line1,
162
    String line2,
163
    String landmark,
164
    String city,
165
    String state,
166
    String pin,
167
    String country,
168
    long id,
169
    boolean enabled,
170
    TAddressType type,
171
    long addedOn)
172
  {
173
    this();
174
    this.line1 = line1;
175
    this.line2 = line2;
176
    this.landmark = landmark;
177
    this.city = city;
178
    this.state = state;
179
    this.pin = pin;
180
    this.country = country;
181
    this.id = id;
182
    setIdIsSet(true);
183
    this.enabled = enabled;
184
    setEnabledIsSet(true);
185
    this.type = type;
186
    this.addedOn = addedOn;
187
    setAddedOnIsSet(true);
188
  }
189
 
190
  /**
191
   * Performs a deep copy on <i>other</i>.
192
   */
193
  public TAddress(TAddress other) {
194
    __isset_bit_vector.clear();
195
    __isset_bit_vector.or(other.__isset_bit_vector);
196
    if (other.isSetLine1()) {
197
      this.line1 = other.line1;
198
    }
199
    if (other.isSetLine2()) {
200
      this.line2 = other.line2;
201
    }
202
    if (other.isSetLandmark()) {
203
      this.landmark = other.landmark;
204
    }
205
    if (other.isSetCity()) {
206
      this.city = other.city;
207
    }
208
    if (other.isSetState()) {
209
      this.state = other.state;
210
    }
211
    if (other.isSetPin()) {
212
      this.pin = other.pin;
213
    }
214
    if (other.isSetCountry()) {
215
      this.country = other.country;
216
    }
217
    this.id = other.id;
218
    this.enabled = other.enabled;
219
    if (other.isSetType()) {
220
      this.type = other.type;
221
    }
222
    this.addedOn = other.addedOn;
223
  }
224
 
225
  public TAddress deepCopy() {
226
    return new TAddress(this);
227
  }
228
 
229
  @Deprecated
230
  public TAddress clone() {
231
    return new TAddress(this);
232
  }
233
 
234
  public String getLine1() {
235
    return this.line1;
236
  }
237
 
238
  public TAddress setLine1(String line1) {
239
    this.line1 = line1;
240
    return this;
241
  }
242
 
243
  public void unsetLine1() {
244
    this.line1 = null;
245
  }
246
 
247
  /** Returns true if field line1 is set (has been asigned a value) and false otherwise */
248
  public boolean isSetLine1() {
249
    return this.line1 != null;
250
  }
251
 
252
  public void setLine1IsSet(boolean value) {
253
    if (!value) {
254
      this.line1 = null;
255
    }
256
  }
257
 
258
  public String getLine2() {
259
    return this.line2;
260
  }
261
 
262
  public TAddress setLine2(String line2) {
263
    this.line2 = line2;
264
    return this;
265
  }
266
 
267
  public void unsetLine2() {
268
    this.line2 = null;
269
  }
270
 
271
  /** Returns true if field line2 is set (has been asigned a value) and false otherwise */
272
  public boolean isSetLine2() {
273
    return this.line2 != null;
274
  }
275
 
276
  public void setLine2IsSet(boolean value) {
277
    if (!value) {
278
      this.line2 = null;
279
    }
280
  }
281
 
282
  public String getLandmark() {
283
    return this.landmark;
284
  }
285
 
286
  public TAddress setLandmark(String landmark) {
287
    this.landmark = landmark;
288
    return this;
289
  }
290
 
291
  public void unsetLandmark() {
292
    this.landmark = null;
293
  }
294
 
295
  /** Returns true if field landmark is set (has been asigned a value) and false otherwise */
296
  public boolean isSetLandmark() {
297
    return this.landmark != null;
298
  }
299
 
300
  public void setLandmarkIsSet(boolean value) {
301
    if (!value) {
302
      this.landmark = null;
303
    }
304
  }
305
 
306
  public String getCity() {
307
    return this.city;
308
  }
309
 
310
  public TAddress setCity(String city) {
311
    this.city = city;
312
    return this;
313
  }
314
 
315
  public void unsetCity() {
316
    this.city = null;
317
  }
318
 
319
  /** Returns true if field city is set (has been asigned a value) and false otherwise */
320
  public boolean isSetCity() {
321
    return this.city != null;
322
  }
323
 
324
  public void setCityIsSet(boolean value) {
325
    if (!value) {
326
      this.city = null;
327
    }
328
  }
329
 
330
  public String getState() {
331
    return this.state;
332
  }
333
 
334
  public TAddress setState(String state) {
335
    this.state = state;
336
    return this;
337
  }
338
 
339
  public void unsetState() {
340
    this.state = null;
341
  }
342
 
343
  /** Returns true if field state is set (has been asigned a value) and false otherwise */
344
  public boolean isSetState() {
345
    return this.state != null;
346
  }
347
 
348
  public void setStateIsSet(boolean value) {
349
    if (!value) {
350
      this.state = null;
351
    }
352
  }
353
 
354
  public String getPin() {
355
    return this.pin;
356
  }
357
 
358
  public TAddress setPin(String pin) {
359
    this.pin = pin;
360
    return this;
361
  }
362
 
363
  public void unsetPin() {
364
    this.pin = null;
365
  }
366
 
367
  /** Returns true if field pin is set (has been asigned a value) and false otherwise */
368
  public boolean isSetPin() {
369
    return this.pin != null;
370
  }
371
 
372
  public void setPinIsSet(boolean value) {
373
    if (!value) {
374
      this.pin = null;
375
    }
376
  }
377
 
378
  public String getCountry() {
379
    return this.country;
380
  }
381
 
382
  public TAddress setCountry(String country) {
383
    this.country = country;
384
    return this;
385
  }
386
 
387
  public void unsetCountry() {
388
    this.country = null;
389
  }
390
 
391
  /** Returns true if field country is set (has been asigned a value) and false otherwise */
392
  public boolean isSetCountry() {
393
    return this.country != null;
394
  }
395
 
396
  public void setCountryIsSet(boolean value) {
397
    if (!value) {
398
      this.country = null;
399
    }
400
  }
401
 
402
  public long getId() {
403
    return this.id;
404
  }
405
 
406
  public TAddress setId(long id) {
407
    this.id = id;
408
    setIdIsSet(true);
409
    return this;
410
  }
411
 
412
  public void unsetId() {
413
    __isset_bit_vector.clear(__ID_ISSET_ID);
414
  }
415
 
416
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
417
  public boolean isSetId() {
418
    return __isset_bit_vector.get(__ID_ISSET_ID);
419
  }
420
 
421
  public void setIdIsSet(boolean value) {
422
    __isset_bit_vector.set(__ID_ISSET_ID, value);
423
  }
424
 
425
  public boolean isEnabled() {
426
    return this.enabled;
427
  }
428
 
429
  public TAddress setEnabled(boolean enabled) {
430
    this.enabled = enabled;
431
    setEnabledIsSet(true);
432
    return this;
433
  }
434
 
435
  public void unsetEnabled() {
436
    __isset_bit_vector.clear(__ENABLED_ISSET_ID);
437
  }
438
 
439
  /** Returns true if field enabled is set (has been asigned a value) and false otherwise */
440
  public boolean isSetEnabled() {
441
    return __isset_bit_vector.get(__ENABLED_ISSET_ID);
442
  }
443
 
444
  public void setEnabledIsSet(boolean value) {
445
    __isset_bit_vector.set(__ENABLED_ISSET_ID, value);
446
  }
447
 
448
  /**
449
   * 
450
   * @see TAddressType
451
   */
452
  public TAddressType getType() {
453
    return this.type;
454
  }
455
 
456
  /**
457
   * 
458
   * @see TAddressType
459
   */
460
  public TAddress setType(TAddressType type) {
461
    this.type = type;
462
    return this;
463
  }
464
 
465
  public void unsetType() {
466
    this.type = null;
467
  }
468
 
469
  /** Returns true if field type is set (has been asigned a value) and false otherwise */
470
  public boolean isSetType() {
471
    return this.type != null;
472
  }
473
 
474
  public void setTypeIsSet(boolean value) {
475
    if (!value) {
476
      this.type = null;
477
    }
478
  }
479
 
480
  public long getAddedOn() {
481
    return this.addedOn;
482
  }
483
 
484
  public TAddress setAddedOn(long addedOn) {
485
    this.addedOn = addedOn;
486
    setAddedOnIsSet(true);
487
    return this;
488
  }
489
 
490
  public void unsetAddedOn() {
491
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
492
  }
493
 
494
  /** Returns true if field addedOn is set (has been asigned a value) and false otherwise */
495
  public boolean isSetAddedOn() {
496
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
497
  }
498
 
499
  public void setAddedOnIsSet(boolean value) {
500
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
501
  }
502
 
503
  public void setFieldValue(_Fields field, Object value) {
504
    switch (field) {
505
    case LINE1:
506
      if (value == null) {
507
        unsetLine1();
508
      } else {
509
        setLine1((String)value);
510
      }
511
      break;
512
 
513
    case LINE2:
514
      if (value == null) {
515
        unsetLine2();
516
      } else {
517
        setLine2((String)value);
518
      }
519
      break;
520
 
521
    case LANDMARK:
522
      if (value == null) {
523
        unsetLandmark();
524
      } else {
525
        setLandmark((String)value);
526
      }
527
      break;
528
 
529
    case CITY:
530
      if (value == null) {
531
        unsetCity();
532
      } else {
533
        setCity((String)value);
534
      }
535
      break;
536
 
537
    case STATE:
538
      if (value == null) {
539
        unsetState();
540
      } else {
541
        setState((String)value);
542
      }
543
      break;
544
 
545
    case PIN:
546
      if (value == null) {
547
        unsetPin();
548
      } else {
549
        setPin((String)value);
550
      }
551
      break;
552
 
553
    case COUNTRY:
554
      if (value == null) {
555
        unsetCountry();
556
      } else {
557
        setCountry((String)value);
558
      }
559
      break;
560
 
561
    case ID:
562
      if (value == null) {
563
        unsetId();
564
      } else {
565
        setId((Long)value);
566
      }
567
      break;
568
 
569
    case ENABLED:
570
      if (value == null) {
571
        unsetEnabled();
572
      } else {
573
        setEnabled((Boolean)value);
574
      }
575
      break;
576
 
577
    case TYPE:
578
      if (value == null) {
579
        unsetType();
580
      } else {
581
        setType((TAddressType)value);
582
      }
583
      break;
584
 
585
    case ADDED_ON:
586
      if (value == null) {
587
        unsetAddedOn();
588
      } else {
589
        setAddedOn((Long)value);
590
      }
591
      break;
592
 
593
    }
594
  }
595
 
596
  public void setFieldValue(int fieldID, Object value) {
597
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
598
  }
599
 
600
  public Object getFieldValue(_Fields field) {
601
    switch (field) {
602
    case LINE1:
603
      return getLine1();
604
 
605
    case LINE2:
606
      return getLine2();
607
 
608
    case LANDMARK:
609
      return getLandmark();
610
 
611
    case CITY:
612
      return getCity();
613
 
614
    case STATE:
615
      return getState();
616
 
617
    case PIN:
618
      return getPin();
619
 
620
    case COUNTRY:
621
      return getCountry();
622
 
623
    case ID:
624
      return new Long(getId());
625
 
626
    case ENABLED:
627
      return new Boolean(isEnabled());
628
 
629
    case TYPE:
630
      return getType();
631
 
632
    case ADDED_ON:
633
      return new Long(getAddedOn());
634
 
635
    }
636
    throw new IllegalStateException();
637
  }
638
 
639
  public Object getFieldValue(int fieldId) {
640
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
641
  }
642
 
643
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
644
  public boolean isSet(_Fields field) {
645
    switch (field) {
646
    case LINE1:
647
      return isSetLine1();
648
    case LINE2:
649
      return isSetLine2();
650
    case LANDMARK:
651
      return isSetLandmark();
652
    case CITY:
653
      return isSetCity();
654
    case STATE:
655
      return isSetState();
656
    case PIN:
657
      return isSetPin();
658
    case COUNTRY:
659
      return isSetCountry();
660
    case ID:
661
      return isSetId();
662
    case ENABLED:
663
      return isSetEnabled();
664
    case TYPE:
665
      return isSetType();
666
    case ADDED_ON:
667
      return isSetAddedOn();
668
    }
669
    throw new IllegalStateException();
670
  }
671
 
672
  public boolean isSet(int fieldID) {
673
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
674
  }
675
 
676
  @Override
677
  public boolean equals(Object that) {
678
    if (that == null)
679
      return false;
680
    if (that instanceof TAddress)
681
      return this.equals((TAddress)that);
682
    return false;
683
  }
684
 
685
  public boolean equals(TAddress that) {
686
    if (that == null)
687
      return false;
688
 
689
    boolean this_present_line1 = true && this.isSetLine1();
690
    boolean that_present_line1 = true && that.isSetLine1();
691
    if (this_present_line1 || that_present_line1) {
692
      if (!(this_present_line1 && that_present_line1))
693
        return false;
694
      if (!this.line1.equals(that.line1))
695
        return false;
696
    }
697
 
698
    boolean this_present_line2 = true && this.isSetLine2();
699
    boolean that_present_line2 = true && that.isSetLine2();
700
    if (this_present_line2 || that_present_line2) {
701
      if (!(this_present_line2 && that_present_line2))
702
        return false;
703
      if (!this.line2.equals(that.line2))
704
        return false;
705
    }
706
 
707
    boolean this_present_landmark = true && this.isSetLandmark();
708
    boolean that_present_landmark = true && that.isSetLandmark();
709
    if (this_present_landmark || that_present_landmark) {
710
      if (!(this_present_landmark && that_present_landmark))
711
        return false;
712
      if (!this.landmark.equals(that.landmark))
713
        return false;
714
    }
715
 
716
    boolean this_present_city = true && this.isSetCity();
717
    boolean that_present_city = true && that.isSetCity();
718
    if (this_present_city || that_present_city) {
719
      if (!(this_present_city && that_present_city))
720
        return false;
721
      if (!this.city.equals(that.city))
722
        return false;
723
    }
724
 
725
    boolean this_present_state = true && this.isSetState();
726
    boolean that_present_state = true && that.isSetState();
727
    if (this_present_state || that_present_state) {
728
      if (!(this_present_state && that_present_state))
729
        return false;
730
      if (!this.state.equals(that.state))
731
        return false;
732
    }
733
 
734
    boolean this_present_pin = true && this.isSetPin();
735
    boolean that_present_pin = true && that.isSetPin();
736
    if (this_present_pin || that_present_pin) {
737
      if (!(this_present_pin && that_present_pin))
738
        return false;
739
      if (!this.pin.equals(that.pin))
740
        return false;
741
    }
742
 
743
    boolean this_present_country = true && this.isSetCountry();
744
    boolean that_present_country = true && that.isSetCountry();
745
    if (this_present_country || that_present_country) {
746
      if (!(this_present_country && that_present_country))
747
        return false;
748
      if (!this.country.equals(that.country))
749
        return false;
750
    }
751
 
752
    boolean this_present_id = true;
753
    boolean that_present_id = true;
754
    if (this_present_id || that_present_id) {
755
      if (!(this_present_id && that_present_id))
756
        return false;
757
      if (this.id != that.id)
758
        return false;
759
    }
760
 
761
    boolean this_present_enabled = true;
762
    boolean that_present_enabled = true;
763
    if (this_present_enabled || that_present_enabled) {
764
      if (!(this_present_enabled && that_present_enabled))
765
        return false;
766
      if (this.enabled != that.enabled)
767
        return false;
768
    }
769
 
770
    boolean this_present_type = true && this.isSetType();
771
    boolean that_present_type = true && that.isSetType();
772
    if (this_present_type || that_present_type) {
773
      if (!(this_present_type && that_present_type))
774
        return false;
775
      if (!this.type.equals(that.type))
776
        return false;
777
    }
778
 
779
    boolean this_present_addedOn = true;
780
    boolean that_present_addedOn = true;
781
    if (this_present_addedOn || that_present_addedOn) {
782
      if (!(this_present_addedOn && that_present_addedOn))
783
        return false;
784
      if (this.addedOn != that.addedOn)
785
        return false;
786
    }
787
 
788
    return true;
789
  }
790
 
791
  @Override
792
  public int hashCode() {
793
    return 0;
794
  }
795
 
796
  public int compareTo(TAddress other) {
797
    if (!getClass().equals(other.getClass())) {
798
      return getClass().getName().compareTo(other.getClass().getName());
799
    }
800
 
801
    int lastComparison = 0;
802
    TAddress typedOther = (TAddress)other;
803
 
804
    lastComparison = Boolean.valueOf(isSetLine1()).compareTo(isSetLine1());
805
    if (lastComparison != 0) {
806
      return lastComparison;
807
    }
808
    lastComparison = TBaseHelper.compareTo(line1, typedOther.line1);
809
    if (lastComparison != 0) {
810
      return lastComparison;
811
    }
812
    lastComparison = Boolean.valueOf(isSetLine2()).compareTo(isSetLine2());
813
    if (lastComparison != 0) {
814
      return lastComparison;
815
    }
816
    lastComparison = TBaseHelper.compareTo(line2, typedOther.line2);
817
    if (lastComparison != 0) {
818
      return lastComparison;
819
    }
820
    lastComparison = Boolean.valueOf(isSetLandmark()).compareTo(isSetLandmark());
821
    if (lastComparison != 0) {
822
      return lastComparison;
823
    }
824
    lastComparison = TBaseHelper.compareTo(landmark, typedOther.landmark);
825
    if (lastComparison != 0) {
826
      return lastComparison;
827
    }
828
    lastComparison = Boolean.valueOf(isSetCity()).compareTo(isSetCity());
829
    if (lastComparison != 0) {
830
      return lastComparison;
831
    }
832
    lastComparison = TBaseHelper.compareTo(city, typedOther.city);
833
    if (lastComparison != 0) {
834
      return lastComparison;
835
    }
836
    lastComparison = Boolean.valueOf(isSetState()).compareTo(isSetState());
837
    if (lastComparison != 0) {
838
      return lastComparison;
839
    }
840
    lastComparison = TBaseHelper.compareTo(state, typedOther.state);
841
    if (lastComparison != 0) {
842
      return lastComparison;
843
    }
844
    lastComparison = Boolean.valueOf(isSetPin()).compareTo(isSetPin());
845
    if (lastComparison != 0) {
846
      return lastComparison;
847
    }
848
    lastComparison = TBaseHelper.compareTo(pin, typedOther.pin);
849
    if (lastComparison != 0) {
850
      return lastComparison;
851
    }
852
    lastComparison = Boolean.valueOf(isSetCountry()).compareTo(isSetCountry());
853
    if (lastComparison != 0) {
854
      return lastComparison;
855
    }
856
    lastComparison = TBaseHelper.compareTo(country, typedOther.country);
857
    if (lastComparison != 0) {
858
      return lastComparison;
859
    }
860
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
861
    if (lastComparison != 0) {
862
      return lastComparison;
863
    }
864
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
865
    if (lastComparison != 0) {
866
      return lastComparison;
867
    }
868
    lastComparison = Boolean.valueOf(isSetEnabled()).compareTo(isSetEnabled());
869
    if (lastComparison != 0) {
870
      return lastComparison;
871
    }
872
    lastComparison = TBaseHelper.compareTo(enabled, typedOther.enabled);
873
    if (lastComparison != 0) {
874
      return lastComparison;
875
    }
876
    lastComparison = Boolean.valueOf(isSetType()).compareTo(isSetType());
877
    if (lastComparison != 0) {
878
      return lastComparison;
879
    }
880
    lastComparison = TBaseHelper.compareTo(type, typedOther.type);
881
    if (lastComparison != 0) {
882
      return lastComparison;
883
    }
884
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(isSetAddedOn());
885
    if (lastComparison != 0) {
886
      return lastComparison;
887
    }
888
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
889
    if (lastComparison != 0) {
890
      return lastComparison;
891
    }
892
    return 0;
893
  }
894
 
895
  public void read(TProtocol iprot) throws TException {
896
    TField field;
897
    iprot.readStructBegin();
898
    while (true)
899
    {
900
      field = iprot.readFieldBegin();
901
      if (field.type == TType.STOP) { 
902
        break;
903
      }
904
      _Fields fieldId = _Fields.findByThriftId(field.id);
905
      if (fieldId == null) {
906
        TProtocolUtil.skip(iprot, field.type);
907
      } else {
908
        switch (fieldId) {
909
          case LINE1:
910
            if (field.type == TType.STRING) {
911
              this.line1 = iprot.readString();
912
            } else { 
913
              TProtocolUtil.skip(iprot, field.type);
914
            }
915
            break;
916
          case LINE2:
917
            if (field.type == TType.STRING) {
918
              this.line2 = iprot.readString();
919
            } else { 
920
              TProtocolUtil.skip(iprot, field.type);
921
            }
922
            break;
923
          case LANDMARK:
924
            if (field.type == TType.STRING) {
925
              this.landmark = iprot.readString();
926
            } else { 
927
              TProtocolUtil.skip(iprot, field.type);
928
            }
929
            break;
930
          case CITY:
931
            if (field.type == TType.STRING) {
932
              this.city = iprot.readString();
933
            } else { 
934
              TProtocolUtil.skip(iprot, field.type);
935
            }
936
            break;
937
          case STATE:
938
            if (field.type == TType.STRING) {
939
              this.state = iprot.readString();
940
            } else { 
941
              TProtocolUtil.skip(iprot, field.type);
942
            }
943
            break;
944
          case PIN:
945
            if (field.type == TType.STRING) {
946
              this.pin = iprot.readString();
947
            } else { 
948
              TProtocolUtil.skip(iprot, field.type);
949
            }
950
            break;
951
          case COUNTRY:
952
            if (field.type == TType.STRING) {
953
              this.country = iprot.readString();
954
            } else { 
955
              TProtocolUtil.skip(iprot, field.type);
956
            }
957
            break;
958
          case ID:
959
            if (field.type == TType.I64) {
960
              this.id = iprot.readI64();
961
              setIdIsSet(true);
962
            } else { 
963
              TProtocolUtil.skip(iprot, field.type);
964
            }
965
            break;
966
          case ENABLED:
967
            if (field.type == TType.BOOL) {
968
              this.enabled = iprot.readBool();
969
              setEnabledIsSet(true);
970
            } else { 
971
              TProtocolUtil.skip(iprot, field.type);
972
            }
973
            break;
974
          case TYPE:
975
            if (field.type == TType.I32) {
976
              this.type = TAddressType.findByValue(iprot.readI32());
977
            } else { 
978
              TProtocolUtil.skip(iprot, field.type);
979
            }
980
            break;
981
          case ADDED_ON:
982
            if (field.type == TType.I64) {
983
              this.addedOn = iprot.readI64();
984
              setAddedOnIsSet(true);
985
            } else { 
986
              TProtocolUtil.skip(iprot, field.type);
987
            }
988
            break;
989
        }
990
        iprot.readFieldEnd();
991
      }
992
    }
993
    iprot.readStructEnd();
994
    validate();
995
  }
996
 
997
  public void write(TProtocol oprot) throws TException {
998
    validate();
999
 
1000
    oprot.writeStructBegin(STRUCT_DESC);
1001
    if (this.line1 != null) {
1002
      oprot.writeFieldBegin(LINE1_FIELD_DESC);
1003
      oprot.writeString(this.line1);
1004
      oprot.writeFieldEnd();
1005
    }
1006
    if (this.line2 != null) {
1007
      oprot.writeFieldBegin(LINE2_FIELD_DESC);
1008
      oprot.writeString(this.line2);
1009
      oprot.writeFieldEnd();
1010
    }
1011
    if (this.landmark != null) {
1012
      oprot.writeFieldBegin(LANDMARK_FIELD_DESC);
1013
      oprot.writeString(this.landmark);
1014
      oprot.writeFieldEnd();
1015
    }
1016
    if (this.city != null) {
1017
      oprot.writeFieldBegin(CITY_FIELD_DESC);
1018
      oprot.writeString(this.city);
1019
      oprot.writeFieldEnd();
1020
    }
1021
    if (this.state != null) {
1022
      oprot.writeFieldBegin(STATE_FIELD_DESC);
1023
      oprot.writeString(this.state);
1024
      oprot.writeFieldEnd();
1025
    }
1026
    if (this.pin != null) {
1027
      oprot.writeFieldBegin(PIN_FIELD_DESC);
1028
      oprot.writeString(this.pin);
1029
      oprot.writeFieldEnd();
1030
    }
1031
    if (this.country != null) {
1032
      oprot.writeFieldBegin(COUNTRY_FIELD_DESC);
1033
      oprot.writeString(this.country);
1034
      oprot.writeFieldEnd();
1035
    }
1036
    oprot.writeFieldBegin(ID_FIELD_DESC);
1037
    oprot.writeI64(this.id);
1038
    oprot.writeFieldEnd();
1039
    oprot.writeFieldBegin(ENABLED_FIELD_DESC);
1040
    oprot.writeBool(this.enabled);
1041
    oprot.writeFieldEnd();
1042
    if (this.type != null) {
1043
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
1044
      oprot.writeI32(this.type.getValue());
1045
      oprot.writeFieldEnd();
1046
    }
1047
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
1048
    oprot.writeI64(this.addedOn);
1049
    oprot.writeFieldEnd();
1050
    oprot.writeFieldStop();
1051
    oprot.writeStructEnd();
1052
  }
1053
 
1054
  @Override
1055
  public String toString() {
1056
    StringBuilder sb = new StringBuilder("TAddress(");
1057
    boolean first = true;
1058
 
1059
    sb.append("line1:");
1060
    if (this.line1 == null) {
1061
      sb.append("null");
1062
    } else {
1063
      sb.append(this.line1);
1064
    }
1065
    first = false;
1066
    if (!first) sb.append(", ");
1067
    sb.append("line2:");
1068
    if (this.line2 == null) {
1069
      sb.append("null");
1070
    } else {
1071
      sb.append(this.line2);
1072
    }
1073
    first = false;
1074
    if (!first) sb.append(", ");
1075
    sb.append("landmark:");
1076
    if (this.landmark == null) {
1077
      sb.append("null");
1078
    } else {
1079
      sb.append(this.landmark);
1080
    }
1081
    first = false;
1082
    if (!first) sb.append(", ");
1083
    sb.append("city:");
1084
    if (this.city == null) {
1085
      sb.append("null");
1086
    } else {
1087
      sb.append(this.city);
1088
    }
1089
    first = false;
1090
    if (!first) sb.append(", ");
1091
    sb.append("state:");
1092
    if (this.state == null) {
1093
      sb.append("null");
1094
    } else {
1095
      sb.append(this.state);
1096
    }
1097
    first = false;
1098
    if (!first) sb.append(", ");
1099
    sb.append("pin:");
1100
    if (this.pin == null) {
1101
      sb.append("null");
1102
    } else {
1103
      sb.append(this.pin);
1104
    }
1105
    first = false;
1106
    if (!first) sb.append(", ");
1107
    sb.append("country:");
1108
    if (this.country == null) {
1109
      sb.append("null");
1110
    } else {
1111
      sb.append(this.country);
1112
    }
1113
    first = false;
1114
    if (!first) sb.append(", ");
1115
    sb.append("id:");
1116
    sb.append(this.id);
1117
    first = false;
1118
    if (!first) sb.append(", ");
1119
    sb.append("enabled:");
1120
    sb.append(this.enabled);
1121
    first = false;
1122
    if (!first) sb.append(", ");
1123
    sb.append("type:");
1124
    if (this.type == null) {
1125
      sb.append("null");
1126
    } else {
1127
      String type_name = type.name();
1128
      if (type_name != null) {
1129
        sb.append(type_name);
1130
        sb.append(" (");
1131
      }
1132
      sb.append(this.type);
1133
      if (type_name != null) {
1134
        sb.append(")");
1135
      }
1136
    }
1137
    first = false;
1138
    if (!first) sb.append(", ");
1139
    sb.append("addedOn:");
1140
    sb.append(this.addedOn);
1141
    first = false;
1142
    sb.append(")");
1143
    return sb.toString();
1144
  }
1145
 
1146
  public void validate() throws TException {
1147
    // check for required fields
1148
  }
1149
 
1150
}
1151