Subversion Repositories SmartDukaan

Rev

Rev 123 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 123 Rev 414
Line 38... Line 38...
38
  private static final TField COUNTRY_FIELD_DESC = new TField("country", TType.STRING, (short)7);
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);
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);
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);
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);
42
  private static final TField ADDED_ON_FIELD_DESC = new TField("addedOn", TType.I64, (short)11);
-
 
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);
43
 
45
 
44
  private String line1;
46
  private String line1;
45
  private String line2;
47
  private String line2;
46
  private String landmark;
48
  private String landmark;
47
  private String city;
49
  private String city;
Line 50... Line 52...
50
  private String country;
52
  private String country;
51
  private long id;
53
  private long id;
52
  private boolean enabled;
54
  private boolean enabled;
53
  private AddressType type;
55
  private AddressType type;
54
  private long addedOn;
56
  private long addedOn;
-
 
57
  private String name;
-
 
58
  private String phone;
55
 
59
 
56
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
60
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
57
  public enum _Fields implements TFieldIdEnum {
61
  public enum _Fields implements TFieldIdEnum {
58
    LINE1((short)1, "line1"),
62
    LINE1((short)1, "line1"),
59
    LINE2((short)2, "line2"),
63
    LINE2((short)2, "line2"),
Line 67... Line 71...
67
    /**
71
    /**
68
     * 
72
     * 
69
     * @see AddressType
73
     * @see AddressType
70
     */
74
     */
71
    TYPE((short)10, "type"),
75
    TYPE((short)10, "type"),
72
    ADDED_ON((short)11, "addedOn");
76
    ADDED_ON((short)11, "addedOn"),
-
 
77
    NAME((short)12, "name"),
-
 
78
    PHONE((short)13, "phone");
73
 
79
 
74
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
80
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
75
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
81
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
76
 
82
 
77
    static {
83
    static {
Line 149... Line 155...
149
        new FieldValueMetaData(TType.BOOL)));
155
        new FieldValueMetaData(TType.BOOL)));
150
    put(_Fields.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, 
156
    put(_Fields.TYPE, new FieldMetaData("type", TFieldRequirementType.DEFAULT, 
151
        new EnumMetaData(TType.ENUM, AddressType.class)));
157
        new EnumMetaData(TType.ENUM, AddressType.class)));
152
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
158
    put(_Fields.ADDED_ON, new FieldMetaData("addedOn", TFieldRequirementType.DEFAULT, 
153
        new FieldValueMetaData(TType.I64)));
159
        new FieldValueMetaData(TType.I64)));
-
 
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)));
154
  }});
164
  }});
155
 
165
 
156
  static {
166
  static {
157
    FieldMetaData.addStructMetaDataMap(Address.class, metaDataMap);
167
    FieldMetaData.addStructMetaDataMap(Address.class, metaDataMap);
158
  }
168
  }
Line 169... Line 179...
169
    String pin,
179
    String pin,
170
    String country,
180
    String country,
171
    long id,
181
    long id,
172
    boolean enabled,
182
    boolean enabled,
173
    AddressType type,
183
    AddressType type,
174
    long addedOn)
184
    long addedOn,
-
 
185
    String name,
-
 
186
    String phone)
175
  {
187
  {
176
    this();
188
    this();
177
    this.line1 = line1;
189
    this.line1 = line1;
178
    this.line2 = line2;
190
    this.line2 = line2;
179
    this.landmark = landmark;
191
    this.landmark = landmark;
Line 186... Line 198...
186
    this.enabled = enabled;
198
    this.enabled = enabled;
187
    setEnabledIsSet(true);
199
    setEnabledIsSet(true);
188
    this.type = type;
200
    this.type = type;
189
    this.addedOn = addedOn;
201
    this.addedOn = addedOn;
190
    setAddedOnIsSet(true);
202
    setAddedOnIsSet(true);
-
 
203
    this.name = name;
-
 
204
    this.phone = phone;
191
  }
205
  }
192
 
206
 
193
  /**
207
  /**
194
   * Performs a deep copy on <i>other</i>.
208
   * Performs a deep copy on <i>other</i>.
195
   */
209
   */
Line 221... Line 235...
221
    this.enabled = other.enabled;
235
    this.enabled = other.enabled;
222
    if (other.isSetType()) {
236
    if (other.isSetType()) {
223
      this.type = other.type;
237
      this.type = other.type;
224
    }
238
    }
225
    this.addedOn = other.addedOn;
239
    this.addedOn = other.addedOn;
-
 
240
    if (other.isSetName()) {
-
 
241
      this.name = other.name;
-
 
242
    }
-
 
243
    if (other.isSetPhone()) {
-
 
244
      this.phone = other.phone;
-
 
245
    }
226
  }
246
  }
227
 
247
 
228
  public Address deepCopy() {
248
  public Address deepCopy() {
229
    return new Address(this);
249
    return new Address(this);
230
  }
250
  }
Line 501... Line 521...
501
 
521
 
502
  public void setAddedOnIsSet(boolean value) {
522
  public void setAddedOnIsSet(boolean value) {
503
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
523
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
504
  }
524
  }
505
 
525
 
-
 
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
 
506
  public void setFieldValue(_Fields field, Object value) {
574
  public void setFieldValue(_Fields field, Object value) {
507
    switch (field) {
575
    switch (field) {
508
    case LINE1:
576
    case LINE1:
509
      if (value == null) {
577
      if (value == null) {
510
        unsetLine1();
578
        unsetLine1();
Line 591... Line 659...
591
      } else {
659
      } else {
592
        setAddedOn((Long)value);
660
        setAddedOn((Long)value);
593
      }
661
      }
594
      break;
662
      break;
595
 
663
 
-
 
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
 
596
    }
680
    }
597
  }
681
  }
598
 
682
 
599
  public void setFieldValue(int fieldID, Object value) {
683
  public void setFieldValue(int fieldID, Object value) {
600
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
684
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 633... Line 717...
633
      return getType();
717
      return getType();
634
 
718
 
635
    case ADDED_ON:
719
    case ADDED_ON:
636
      return new Long(getAddedOn());
720
      return new Long(getAddedOn());
637
 
721
 
-
 
722
    case NAME:
-
 
723
      return getName();
-
 
724
 
-
 
725
    case PHONE:
-
 
726
      return getPhone();
-
 
727
 
638
    }
728
    }
639
    throw new IllegalStateException();
729
    throw new IllegalStateException();
640
  }
730
  }
641
 
731
 
642
  public Object getFieldValue(int fieldId) {
732
  public Object getFieldValue(int fieldId) {
Line 666... Line 756...
666
      return isSetEnabled();
756
      return isSetEnabled();
667
    case TYPE:
757
    case TYPE:
668
      return isSetType();
758
      return isSetType();
669
    case ADDED_ON:
759
    case ADDED_ON:
670
      return isSetAddedOn();
760
      return isSetAddedOn();
-
 
761
    case NAME:
-
 
762
      return isSetName();
-
 
763
    case PHONE:
-
 
764
      return isSetPhone();
671
    }
765
    }
672
    throw new IllegalStateException();
766
    throw new IllegalStateException();
673
  }
767
  }
674
 
768
 
675
  public boolean isSet(int fieldID) {
769
  public boolean isSet(int fieldID) {
Line 786... Line 880...
786
        return false;
880
        return false;
787
      if (this.addedOn != that.addedOn)
881
      if (this.addedOn != that.addedOn)
788
        return false;
882
        return false;
789
    }
883
    }
790
 
884
 
-
 
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
 
791
    return true;
903
    return true;
792
  }
904
  }
793
 
905
 
794
  @Override
906
  @Override
795
  public int hashCode() {
907
  public int hashCode() {
Line 890... Line 1002...
890
    }
1002
    }
891
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
1003
    lastComparison = TBaseHelper.compareTo(addedOn, typedOther.addedOn);
892
    if (lastComparison != 0) {
1004
    if (lastComparison != 0) {
893
      return lastComparison;
1005
      return lastComparison;
894
    }
1006
    }
-
 
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
    }
895
    return 0;
1023
    return 0;
896
  }
1024
  }
897
 
1025
 
898
  public void read(TProtocol iprot) throws TException {
1026
  public void read(TProtocol iprot) throws TException {
899
    TField field;
1027
    TField field;
Line 987... Line 1115...
987
              setAddedOnIsSet(true);
1115
              setAddedOnIsSet(true);
988
            } else { 
1116
            } else { 
989
              TProtocolUtil.skip(iprot, field.type);
1117
              TProtocolUtil.skip(iprot, field.type);
990
            }
1118
            }
991
            break;
1119
            break;
-
 
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;
992
        }
1134
        }
993
        iprot.readFieldEnd();
1135
        iprot.readFieldEnd();
994
      }
1136
      }
995
    }
1137
    }
996
    iprot.readStructEnd();
1138
    iprot.readStructEnd();
Line 1048... Line 1190...
1048
      oprot.writeFieldEnd();
1190
      oprot.writeFieldEnd();
1049
    }
1191
    }
1050
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
1192
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
1051
    oprot.writeI64(this.addedOn);
1193
    oprot.writeI64(this.addedOn);
1052
    oprot.writeFieldEnd();
1194
    oprot.writeFieldEnd();
-
 
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
    }
1053
    oprot.writeFieldStop();
1205
    oprot.writeFieldStop();
1054
    oprot.writeStructEnd();
1206
    oprot.writeStructEnd();
1055
  }
1207
  }
1056
 
1208
 
1057
  @Override
1209
  @Override
Line 1140... Line 1292...
1140
    first = false;
1292
    first = false;
1141
    if (!first) sb.append(", ");
1293
    if (!first) sb.append(", ");
1142
    sb.append("addedOn:");
1294
    sb.append("addedOn:");
1143
    sb.append(this.addedOn);
1295
    sb.append(this.addedOn);
1144
    first = false;
1296
    first = false;
-
 
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;
1145
    sb.append(")");
1313
    sb.append(")");
1146
    return sb.toString();
1314
    return sb.toString();
1147
  }
1315
  }
1148
 
1316
 
1149
  public void validate() throws TException {
1317
  public void validate() throws TException {