Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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