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