Subversion Repositories SmartDukaan

Rev

Rev 553 | Rev 3430 | Go to most recent revision | Details | Compare with Previous | 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
 
553 chandransh 32
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
33
  private static final TField LINE1_FIELD_DESC = new TField("line1", TType.STRING, (short)2);
34
  private static final TField LINE2_FIELD_DESC = new TField("line2", TType.STRING, (short)3);
35
  private static final TField LANDMARK_FIELD_DESC = new TField("landmark", TType.STRING, (short)4);
36
  private static final TField CITY_FIELD_DESC = new TField("city", TType.STRING, (short)5);
37
  private static final TField STATE_FIELD_DESC = new TField("state", TType.STRING, (short)6);
38
  private static final TField PIN_FIELD_DESC = new TField("pin", TType.STRING, (short)7);
39
  private static final TField COUNTRY_FIELD_DESC = new TField("country", TType.STRING, (short)8);
123 ashish 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
 
553 chandransh 46
  private long id;
123 ashish 47
  private String line1;
48
  private String line2;
49
  private String landmark;
50
  private String city;
51
  private String state;
52
  private String pin;
53
  private String country;
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 {
553 chandransh 62
    ID((short)1, "id"),
63
    LINE1((short)2, "line1"),
64
    LINE2((short)3, "line2"),
65
    LANDMARK((short)4, "landmark"),
66
    CITY((short)5, "city"),
67
    STATE((short)6, "state"),
68
    PIN((short)7, "pin"),
69
    COUNTRY((short)8, "country"),
123 ashish 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) {{
553 chandransh 138
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
139
        new FieldValueMetaData(TType.I64)));
123 ashish 140
    put(_Fields.LINE1, new FieldMetaData("line1", TFieldRequirementType.DEFAULT, 
141
        new FieldValueMetaData(TType.STRING)));
142
    put(_Fields.LINE2, new FieldMetaData("line2", TFieldRequirementType.DEFAULT, 
143
        new FieldValueMetaData(TType.STRING)));
144
    put(_Fields.LANDMARK, new FieldMetaData("landmark", TFieldRequirementType.DEFAULT, 
145
        new FieldValueMetaData(TType.STRING)));
146
    put(_Fields.CITY, new FieldMetaData("city", TFieldRequirementType.DEFAULT, 
147
        new FieldValueMetaData(TType.STRING)));
148
    put(_Fields.STATE, new FieldMetaData("state", TFieldRequirementType.DEFAULT, 
149
        new FieldValueMetaData(TType.STRING)));
150
    put(_Fields.PIN, new FieldMetaData("pin", TFieldRequirementType.DEFAULT, 
151
        new FieldValueMetaData(TType.STRING)));
152
    put(_Fields.COUNTRY, new FieldMetaData("country", TFieldRequirementType.DEFAULT, 
153
        new FieldValueMetaData(TType.STRING)));
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(
553 chandransh 174
    long id,
123 ashish 175
    String line1,
176
    String line2,
177
    String landmark,
178
    String city,
179
    String state,
180
    String pin,
181
    String country,
182
    boolean enabled,
183
    AddressType type,
414 ashish 184
    long addedOn,
185
    String name,
186
    String phone)
123 ashish 187
  {
188
    this();
553 chandransh 189
    this.id = id;
190
    setIdIsSet(true);
123 ashish 191
    this.line1 = line1;
192
    this.line2 = line2;
193
    this.landmark = landmark;
194
    this.city = city;
195
    this.state = state;
196
    this.pin = pin;
197
    this.country = country;
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);
553 chandransh 213
    this.id = other.id;
123 ashish 214
    if (other.isSetLine1()) {
215
      this.line1 = other.line1;
216
    }
217
    if (other.isSetLine2()) {
218
      this.line2 = other.line2;
219
    }
220
    if (other.isSetLandmark()) {
221
      this.landmark = other.landmark;
222
    }
223
    if (other.isSetCity()) {
224
      this.city = other.city;
225
    }
226
    if (other.isSetState()) {
227
      this.state = other.state;
228
    }
229
    if (other.isSetPin()) {
230
      this.pin = other.pin;
231
    }
232
    if (other.isSetCountry()) {
233
      this.country = other.country;
234
    }
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
 
553 chandransh 257
  public long getId() {
258
    return this.id;
259
  }
260
 
261
  public Address setId(long id) {
262
    this.id = id;
263
    setIdIsSet(true);
264
    return this;
265
  }
266
 
267
  public void unsetId() {
268
    __isset_bit_vector.clear(__ID_ISSET_ID);
269
  }
270
 
271
  /** Returns true if field id is set (has been asigned a value) and false otherwise */
272
  public boolean isSetId() {
273
    return __isset_bit_vector.get(__ID_ISSET_ID);
274
  }
275
 
276
  public void setIdIsSet(boolean value) {
277
    __isset_bit_vector.set(__ID_ISSET_ID, value);
278
  }
279
 
123 ashish 280
  public String getLine1() {
281
    return this.line1;
282
  }
283
 
284
  public Address setLine1(String line1) {
285
    this.line1 = line1;
286
    return this;
287
  }
288
 
289
  public void unsetLine1() {
290
    this.line1 = null;
291
  }
292
 
293
  /** Returns true if field line1 is set (has been asigned a value) and false otherwise */
294
  public boolean isSetLine1() {
295
    return this.line1 != null;
296
  }
297
 
298
  public void setLine1IsSet(boolean value) {
299
    if (!value) {
300
      this.line1 = null;
301
    }
302
  }
303
 
304
  public String getLine2() {
305
    return this.line2;
306
  }
307
 
308
  public Address setLine2(String line2) {
309
    this.line2 = line2;
310
    return this;
311
  }
312
 
313
  public void unsetLine2() {
314
    this.line2 = null;
315
  }
316
 
317
  /** Returns true if field line2 is set (has been asigned a value) and false otherwise */
318
  public boolean isSetLine2() {
319
    return this.line2 != null;
320
  }
321
 
322
  public void setLine2IsSet(boolean value) {
323
    if (!value) {
324
      this.line2 = null;
325
    }
326
  }
327
 
328
  public String getLandmark() {
329
    return this.landmark;
330
  }
331
 
332
  public Address setLandmark(String landmark) {
333
    this.landmark = landmark;
334
    return this;
335
  }
336
 
337
  public void unsetLandmark() {
338
    this.landmark = null;
339
  }
340
 
341
  /** Returns true if field landmark is set (has been asigned a value) and false otherwise */
342
  public boolean isSetLandmark() {
343
    return this.landmark != null;
344
  }
345
 
346
  public void setLandmarkIsSet(boolean value) {
347
    if (!value) {
348
      this.landmark = null;
349
    }
350
  }
351
 
352
  public String getCity() {
353
    return this.city;
354
  }
355
 
356
  public Address setCity(String city) {
357
    this.city = city;
358
    return this;
359
  }
360
 
361
  public void unsetCity() {
362
    this.city = null;
363
  }
364
 
365
  /** Returns true if field city is set (has been asigned a value) and false otherwise */
366
  public boolean isSetCity() {
367
    return this.city != null;
368
  }
369
 
370
  public void setCityIsSet(boolean value) {
371
    if (!value) {
372
      this.city = null;
373
    }
374
  }
375
 
376
  public String getState() {
377
    return this.state;
378
  }
379
 
380
  public Address setState(String state) {
381
    this.state = state;
382
    return this;
383
  }
384
 
385
  public void unsetState() {
386
    this.state = null;
387
  }
388
 
389
  /** Returns true if field state is set (has been asigned a value) and false otherwise */
390
  public boolean isSetState() {
391
    return this.state != null;
392
  }
393
 
394
  public void setStateIsSet(boolean value) {
395
    if (!value) {
396
      this.state = null;
397
    }
398
  }
399
 
400
  public String getPin() {
401
    return this.pin;
402
  }
403
 
404
  public Address setPin(String pin) {
405
    this.pin = pin;
406
    return this;
407
  }
408
 
409
  public void unsetPin() {
410
    this.pin = null;
411
  }
412
 
413
  /** Returns true if field pin is set (has been asigned a value) and false otherwise */
414
  public boolean isSetPin() {
415
    return this.pin != null;
416
  }
417
 
418
  public void setPinIsSet(boolean value) {
419
    if (!value) {
420
      this.pin = null;
421
    }
422
  }
423
 
424
  public String getCountry() {
425
    return this.country;
426
  }
427
 
428
  public Address setCountry(String country) {
429
    this.country = country;
430
    return this;
431
  }
432
 
433
  public void unsetCountry() {
434
    this.country = null;
435
  }
436
 
437
  /** Returns true if field country is set (has been asigned a value) and false otherwise */
438
  public boolean isSetCountry() {
439
    return this.country != null;
440
  }
441
 
442
  public void setCountryIsSet(boolean value) {
443
    if (!value) {
444
      this.country = null;
445
    }
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) {
553 chandransh 576
    case ID:
577
      if (value == null) {
578
        unsetId();
579
      } else {
580
        setId((Long)value);
581
      }
582
      break;
583
 
123 ashish 584
    case LINE1:
585
      if (value == null) {
586
        unsetLine1();
587
      } else {
588
        setLine1((String)value);
589
      }
590
      break;
591
 
592
    case LINE2:
593
      if (value == null) {
594
        unsetLine2();
595
      } else {
596
        setLine2((String)value);
597
      }
598
      break;
599
 
600
    case LANDMARK:
601
      if (value == null) {
602
        unsetLandmark();
603
      } else {
604
        setLandmark((String)value);
605
      }
606
      break;
607
 
608
    case CITY:
609
      if (value == null) {
610
        unsetCity();
611
      } else {
612
        setCity((String)value);
613
      }
614
      break;
615
 
616
    case STATE:
617
      if (value == null) {
618
        unsetState();
619
      } else {
620
        setState((String)value);
621
      }
622
      break;
623
 
624
    case PIN:
625
      if (value == null) {
626
        unsetPin();
627
      } else {
628
        setPin((String)value);
629
      }
630
      break;
631
 
632
    case COUNTRY:
633
      if (value == null) {
634
        unsetCountry();
635
      } else {
636
        setCountry((String)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) {
553 chandransh 689
    case ID:
690
      return new Long(getId());
691
 
123 ashish 692
    case LINE1:
693
      return getLine1();
694
 
695
    case LINE2:
696
      return getLine2();
697
 
698
    case LANDMARK:
699
      return getLandmark();
700
 
701
    case CITY:
702
      return getCity();
703
 
704
    case STATE:
705
      return getState();
706
 
707
    case PIN:
708
      return getPin();
709
 
710
    case COUNTRY:
711
      return getCountry();
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) {
553 chandransh 739
    case ID:
740
      return isSetId();
123 ashish 741
    case LINE1:
742
      return isSetLine1();
743
    case LINE2:
744
      return isSetLine2();
745
    case LANDMARK:
746
      return isSetLandmark();
747
    case CITY:
748
      return isSetCity();
749
    case STATE:
750
      return isSetState();
751
    case PIN:
752
      return isSetPin();
753
    case COUNTRY:
754
      return isSetCountry();
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
 
553 chandransh 786
    boolean this_present_id = true;
787
    boolean that_present_id = true;
788
    if (this_present_id || that_present_id) {
789
      if (!(this_present_id && that_present_id))
790
        return false;
791
      if (this.id != that.id)
792
        return false;
793
    }
794
 
123 ashish 795
    boolean this_present_line1 = true && this.isSetLine1();
796
    boolean that_present_line1 = true && that.isSetLine1();
797
    if (this_present_line1 || that_present_line1) {
798
      if (!(this_present_line1 && that_present_line1))
799
        return false;
800
      if (!this.line1.equals(that.line1))
801
        return false;
802
    }
803
 
804
    boolean this_present_line2 = true && this.isSetLine2();
805
    boolean that_present_line2 = true && that.isSetLine2();
806
    if (this_present_line2 || that_present_line2) {
807
      if (!(this_present_line2 && that_present_line2))
808
        return false;
809
      if (!this.line2.equals(that.line2))
810
        return false;
811
    }
812
 
813
    boolean this_present_landmark = true && this.isSetLandmark();
814
    boolean that_present_landmark = true && that.isSetLandmark();
815
    if (this_present_landmark || that_present_landmark) {
816
      if (!(this_present_landmark && that_present_landmark))
817
        return false;
818
      if (!this.landmark.equals(that.landmark))
819
        return false;
820
    }
821
 
822
    boolean this_present_city = true && this.isSetCity();
823
    boolean that_present_city = true && that.isSetCity();
824
    if (this_present_city || that_present_city) {
825
      if (!(this_present_city && that_present_city))
826
        return false;
827
      if (!this.city.equals(that.city))
828
        return false;
829
    }
830
 
831
    boolean this_present_state = true && this.isSetState();
832
    boolean that_present_state = true && that.isSetState();
833
    if (this_present_state || that_present_state) {
834
      if (!(this_present_state && that_present_state))
835
        return false;
836
      if (!this.state.equals(that.state))
837
        return false;
838
    }
839
 
840
    boolean this_present_pin = true && this.isSetPin();
841
    boolean that_present_pin = true && that.isSetPin();
842
    if (this_present_pin || that_present_pin) {
843
      if (!(this_present_pin && that_present_pin))
844
        return false;
845
      if (!this.pin.equals(that.pin))
846
        return false;
847
    }
848
 
849
    boolean this_present_country = true && this.isSetCountry();
850
    boolean that_present_country = true && that.isSetCountry();
851
    if (this_present_country || that_present_country) {
852
      if (!(this_present_country && that_present_country))
853
        return false;
854
      if (!this.country.equals(that.country))
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
 
553 chandransh 919
    lastComparison = Boolean.valueOf(isSetId()).compareTo(isSetId());
920
    if (lastComparison != 0) {
921
      return lastComparison;
922
    }
923
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
924
    if (lastComparison != 0) {
925
      return lastComparison;
926
    }
123 ashish 927
    lastComparison = Boolean.valueOf(isSetLine1()).compareTo(isSetLine1());
928
    if (lastComparison != 0) {
929
      return lastComparison;
930
    }
931
    lastComparison = TBaseHelper.compareTo(line1, typedOther.line1);
932
    if (lastComparison != 0) {
933
      return lastComparison;
934
    }
935
    lastComparison = Boolean.valueOf(isSetLine2()).compareTo(isSetLine2());
936
    if (lastComparison != 0) {
937
      return lastComparison;
938
    }
939
    lastComparison = TBaseHelper.compareTo(line2, typedOther.line2);
940
    if (lastComparison != 0) {
941
      return lastComparison;
942
    }
943
    lastComparison = Boolean.valueOf(isSetLandmark()).compareTo(isSetLandmark());
944
    if (lastComparison != 0) {
945
      return lastComparison;
946
    }
947
    lastComparison = TBaseHelper.compareTo(landmark, typedOther.landmark);
948
    if (lastComparison != 0) {
949
      return lastComparison;
950
    }
951
    lastComparison = Boolean.valueOf(isSetCity()).compareTo(isSetCity());
952
    if (lastComparison != 0) {
953
      return lastComparison;
954
    }
955
    lastComparison = TBaseHelper.compareTo(city, typedOther.city);
956
    if (lastComparison != 0) {
957
      return lastComparison;
958
    }
959
    lastComparison = Boolean.valueOf(isSetState()).compareTo(isSetState());
960
    if (lastComparison != 0) {
961
      return lastComparison;
962
    }
963
    lastComparison = TBaseHelper.compareTo(state, typedOther.state);
964
    if (lastComparison != 0) {
965
      return lastComparison;
966
    }
967
    lastComparison = Boolean.valueOf(isSetPin()).compareTo(isSetPin());
968
    if (lastComparison != 0) {
969
      return lastComparison;
970
    }
971
    lastComparison = TBaseHelper.compareTo(pin, typedOther.pin);
972
    if (lastComparison != 0) {
973
      return lastComparison;
974
    }
975
    lastComparison = Boolean.valueOf(isSetCountry()).compareTo(isSetCountry());
976
    if (lastComparison != 0) {
977
      return lastComparison;
978
    }
979
    lastComparison = TBaseHelper.compareTo(country, typedOther.country);
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) {
553 chandransh 1040
          case ID:
1041
            if (field.type == TType.I64) {
1042
              this.id = iprot.readI64();
1043
              setIdIsSet(true);
1044
            } else { 
1045
              TProtocolUtil.skip(iprot, field.type);
1046
            }
1047
            break;
123 ashish 1048
          case LINE1:
1049
            if (field.type == TType.STRING) {
1050
              this.line1 = iprot.readString();
1051
            } else { 
1052
              TProtocolUtil.skip(iprot, field.type);
1053
            }
1054
            break;
1055
          case LINE2:
1056
            if (field.type == TType.STRING) {
1057
              this.line2 = iprot.readString();
1058
            } else { 
1059
              TProtocolUtil.skip(iprot, field.type);
1060
            }
1061
            break;
1062
          case LANDMARK:
1063
            if (field.type == TType.STRING) {
1064
              this.landmark = iprot.readString();
1065
            } else { 
1066
              TProtocolUtil.skip(iprot, field.type);
1067
            }
1068
            break;
1069
          case CITY:
1070
            if (field.type == TType.STRING) {
1071
              this.city = iprot.readString();
1072
            } else { 
1073
              TProtocolUtil.skip(iprot, field.type);
1074
            }
1075
            break;
1076
          case STATE:
1077
            if (field.type == TType.STRING) {
1078
              this.state = iprot.readString();
1079
            } else { 
1080
              TProtocolUtil.skip(iprot, field.type);
1081
            }
1082
            break;
1083
          case PIN:
1084
            if (field.type == TType.STRING) {
1085
              this.pin = iprot.readString();
1086
            } else { 
1087
              TProtocolUtil.skip(iprot, field.type);
1088
            }
1089
            break;
1090
          case COUNTRY:
1091
            if (field.type == TType.STRING) {
1092
              this.country = iprot.readString();
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);
553 chandransh 1146
    oprot.writeFieldBegin(ID_FIELD_DESC);
1147
    oprot.writeI64(this.id);
1148
    oprot.writeFieldEnd();
123 ashish 1149
    if (this.line1 != null) {
1150
      oprot.writeFieldBegin(LINE1_FIELD_DESC);
1151
      oprot.writeString(this.line1);
1152
      oprot.writeFieldEnd();
1153
    }
1154
    if (this.line2 != null) {
1155
      oprot.writeFieldBegin(LINE2_FIELD_DESC);
1156
      oprot.writeString(this.line2);
1157
      oprot.writeFieldEnd();
1158
    }
1159
    if (this.landmark != null) {
1160
      oprot.writeFieldBegin(LANDMARK_FIELD_DESC);
1161
      oprot.writeString(this.landmark);
1162
      oprot.writeFieldEnd();
1163
    }
1164
    if (this.city != null) {
1165
      oprot.writeFieldBegin(CITY_FIELD_DESC);
1166
      oprot.writeString(this.city);
1167
      oprot.writeFieldEnd();
1168
    }
1169
    if (this.state != null) {
1170
      oprot.writeFieldBegin(STATE_FIELD_DESC);
1171
      oprot.writeString(this.state);
1172
      oprot.writeFieldEnd();
1173
    }
1174
    if (this.pin != null) {
1175
      oprot.writeFieldBegin(PIN_FIELD_DESC);
1176
      oprot.writeString(this.pin);
1177
      oprot.writeFieldEnd();
1178
    }
1179
    if (this.country != null) {
1180
      oprot.writeFieldBegin(COUNTRY_FIELD_DESC);
1181
      oprot.writeString(this.country);
1182
      oprot.writeFieldEnd();
1183
    }
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
 
553 chandransh 1214
    sb.append("id:");
1215
    sb.append(this.id);
1216
    first = false;
1217
    if (!first) sb.append(", ");
123 ashish 1218
    sb.append("line1:");
1219
    if (this.line1 == null) {
1220
      sb.append("null");
1221
    } else {
1222
      sb.append(this.line1);
1223
    }
1224
    first = false;
1225
    if (!first) sb.append(", ");
1226
    sb.append("line2:");
1227
    if (this.line2 == null) {
1228
      sb.append("null");
1229
    } else {
1230
      sb.append(this.line2);
1231
    }
1232
    first = false;
1233
    if (!first) sb.append(", ");
1234
    sb.append("landmark:");
1235
    if (this.landmark == null) {
1236
      sb.append("null");
1237
    } else {
1238
      sb.append(this.landmark);
1239
    }
1240
    first = false;
1241
    if (!first) sb.append(", ");
1242
    sb.append("city:");
1243
    if (this.city == null) {
1244
      sb.append("null");
1245
    } else {
1246
      sb.append(this.city);
1247
    }
1248
    first = false;
1249
    if (!first) sb.append(", ");
1250
    sb.append("state:");
1251
    if (this.state == null) {
1252
      sb.append("null");
1253
    } else {
1254
      sb.append(this.state);
1255
    }
1256
    first = false;
1257
    if (!first) sb.append(", ");
1258
    sb.append("pin:");
1259
    if (this.pin == null) {
1260
      sb.append("null");
1261
    } else {
1262
      sb.append(this.pin);
1263
    }
1264
    first = false;
1265
    if (!first) sb.append(", ");
1266
    sb.append("country:");
1267
    if (this.country == null) {
1268
      sb.append("null");
1269
    } else {
1270
      sb.append(this.country);
1271
    }
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