Subversion Repositories SmartDukaan

Rev

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

Rev 130 Rev 506
Line 47... Line 47...
47
  private static final TField SHIPMENT_OPTION_FIELD_DESC = new TField("shipmentOption", TType.I32, (short)16);
47
  private static final TField SHIPMENT_OPTION_FIELD_DESC = new TField("shipmentOption", TType.I32, (short)16);
48
  private static final TField MIDDLE_NAME_FIELD_DESC = new TField("middleName", TType.STRING, (short)17);
48
  private static final TField MIDDLE_NAME_FIELD_DESC = new TField("middleName", TType.STRING, (short)17);
49
  private static final TField OCCUPATION_FIELD_DESC = new TField("occupation", TType.STRING, (short)18);
49
  private static final TField OCCUPATION_FIELD_DESC = new TField("occupation", TType.STRING, (short)18);
50
  private static final TField HINT_QUESTION_FIELD_DESC = new TField("hintQuestion", TType.STRING, (short)19);
50
  private static final TField HINT_QUESTION_FIELD_DESC = new TField("hintQuestion", TType.STRING, (short)19);
51
  private static final TField HINT_ANSWER_FIELD_DESC = new TField("hintAnswer", TType.STRING, (short)20);
51
  private static final TField HINT_ANSWER_FIELD_DESC = new TField("hintAnswer", TType.STRING, (short)20);
-
 
52
  private static final TField DEFAULT_ADDRESS_ID_FIELD_DESC = new TField("defaultAddressId", TType.I64, (short)21);
-
 
53
  private static final TField COMMUNICATION_EMAIL_FIELD_DESC = new TField("communicationEmail", TType.STRING, (short)22);
52
 
54
 
53
  private long userId;
55
  private long userId;
54
  private String title;
56
  private String title;
55
  private String firstName;
57
  private String firstName;
56
  private String lastName;
58
  private String lastName;
Line 67... Line 69...
67
  private int shipmentOption;
69
  private int shipmentOption;
68
  private String middleName;
70
  private String middleName;
69
  private String occupation;
71
  private String occupation;
70
  private String hintQuestion;
72
  private String hintQuestion;
71
  private String hintAnswer;
73
  private String hintAnswer;
-
 
74
  private long defaultAddressId;
-
 
75
  private String communicationEmail;
72
 
76
 
73
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
77
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
74
  public enum _Fields implements TFieldIdEnum {
78
  public enum _Fields implements TFieldIdEnum {
75
    USER_ID((short)1, "userId"),
79
    USER_ID((short)1, "userId"),
76
    TITLE((short)2, "title"),
80
    TITLE((short)2, "title"),
Line 88... Line 92...
88
    ADDRESSES((short)14, "addresses"),
92
    ADDRESSES((short)14, "addresses"),
89
    SHIPMENT_OPTION((short)16, "shipmentOption"),
93
    SHIPMENT_OPTION((short)16, "shipmentOption"),
90
    MIDDLE_NAME((short)17, "middleName"),
94
    MIDDLE_NAME((short)17, "middleName"),
91
    OCCUPATION((short)18, "occupation"),
95
    OCCUPATION((short)18, "occupation"),
92
    HINT_QUESTION((short)19, "hintQuestion"),
96
    HINT_QUESTION((short)19, "hintQuestion"),
93
    HINT_ANSWER((short)20, "hintAnswer");
97
    HINT_ANSWER((short)20, "hintAnswer"),
-
 
98
    DEFAULT_ADDRESS_ID((short)21, "defaultAddressId"),
-
 
99
    COMMUNICATION_EMAIL((short)22, "communicationEmail");
94
 
100
 
95
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
101
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
96
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
102
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
97
 
103
 
98
    static {
104
    static {
Line 146... Line 152...
146
  // isset id assignments
152
  // isset id assignments
147
  private static final int __USERID_ISSET_ID = 0;
153
  private static final int __USERID_ISSET_ID = 0;
148
  private static final int __DATEOFBIRTH_ISSET_ID = 1;
154
  private static final int __DATEOFBIRTH_ISSET_ID = 1;
149
  private static final int __ANNIVERSARY_ISSET_ID = 2;
155
  private static final int __ANNIVERSARY_ISSET_ID = 2;
150
  private static final int __SHIPMENTOPTION_ISSET_ID = 3;
156
  private static final int __SHIPMENTOPTION_ISSET_ID = 3;
-
 
157
  private static final int __DEFAULTADDRESSID_ISSET_ID = 4;
151
  private BitSet __isset_bit_vector = new BitSet(4);
158
  private BitSet __isset_bit_vector = new BitSet(5);
152
 
159
 
153
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
160
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
154
    put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
161
    put(_Fields.USER_ID, new FieldMetaData("userId", TFieldRequirementType.DEFAULT, 
155
        new FieldValueMetaData(TType.I64)));
162
        new FieldValueMetaData(TType.I64)));
156
    put(_Fields.TITLE, new FieldMetaData("title", TFieldRequirementType.DEFAULT, 
163
    put(_Fields.TITLE, new FieldMetaData("title", TFieldRequirementType.DEFAULT, 
Line 189... Line 196...
189
        new FieldValueMetaData(TType.STRING)));
196
        new FieldValueMetaData(TType.STRING)));
190
    put(_Fields.HINT_QUESTION, new FieldMetaData("hintQuestion", TFieldRequirementType.DEFAULT, 
197
    put(_Fields.HINT_QUESTION, new FieldMetaData("hintQuestion", TFieldRequirementType.DEFAULT, 
191
        new FieldValueMetaData(TType.STRING)));
198
        new FieldValueMetaData(TType.STRING)));
192
    put(_Fields.HINT_ANSWER, new FieldMetaData("hintAnswer", TFieldRequirementType.DEFAULT, 
199
    put(_Fields.HINT_ANSWER, new FieldMetaData("hintAnswer", TFieldRequirementType.DEFAULT, 
193
        new FieldValueMetaData(TType.STRING)));
200
        new FieldValueMetaData(TType.STRING)));
-
 
201
    put(_Fields.DEFAULT_ADDRESS_ID, new FieldMetaData("defaultAddressId", TFieldRequirementType.DEFAULT, 
-
 
202
        new FieldValueMetaData(TType.I64)));
-
 
203
    put(_Fields.COMMUNICATION_EMAIL, new FieldMetaData("communicationEmail", TFieldRequirementType.DEFAULT, 
-
 
204
        new FieldValueMetaData(TType.STRING)));
194
  }});
205
  }});
195
 
206
 
196
  static {
207
  static {
197
    FieldMetaData.addStructMetaDataMap(UserPrimaryInfo.class, metaDataMap);
208
    FieldMetaData.addStructMetaDataMap(UserPrimaryInfo.class, metaDataMap);
198
  }
209
  }
Line 217... Line 228...
217
    Set<Address> addresses,
228
    Set<Address> addresses,
218
    int shipmentOption,
229
    int shipmentOption,
219
    String middleName,
230
    String middleName,
220
    String occupation,
231
    String occupation,
221
    String hintQuestion,
232
    String hintQuestion,
222
    String hintAnswer)
233
    String hintAnswer,
-
 
234
    long defaultAddressId,
-
 
235
    String communicationEmail)
223
  {
236
  {
224
    this();
237
    this();
225
    this.userId = userId;
238
    this.userId = userId;
226
    setUserIdIsSet(true);
239
    setUserIdIsSet(true);
227
    this.title = title;
240
    this.title = title;
Line 243... Line 256...
243
    setShipmentOptionIsSet(true);
256
    setShipmentOptionIsSet(true);
244
    this.middleName = middleName;
257
    this.middleName = middleName;
245
    this.occupation = occupation;
258
    this.occupation = occupation;
246
    this.hintQuestion = hintQuestion;
259
    this.hintQuestion = hintQuestion;
247
    this.hintAnswer = hintAnswer;
260
    this.hintAnswer = hintAnswer;
-
 
261
    this.defaultAddressId = defaultAddressId;
-
 
262
    setDefaultAddressIdIsSet(true);
-
 
263
    this.communicationEmail = communicationEmail;
248
  }
264
  }
249
 
265
 
250
  /**
266
  /**
251
   * Performs a deep copy on <i>other</i>.
267
   * Performs a deep copy on <i>other</i>.
252
   */
268
   */
Line 308... Line 324...
308
      this.hintQuestion = other.hintQuestion;
324
      this.hintQuestion = other.hintQuestion;
309
    }
325
    }
310
    if (other.isSetHintAnswer()) {
326
    if (other.isSetHintAnswer()) {
311
      this.hintAnswer = other.hintAnswer;
327
      this.hintAnswer = other.hintAnswer;
312
    }
328
    }
-
 
329
    this.defaultAddressId = other.defaultAddressId;
-
 
330
    if (other.isSetCommunicationEmail()) {
-
 
331
      this.communicationEmail = other.communicationEmail;
-
 
332
    }
313
  }
333
  }
314
 
334
 
315
  public UserPrimaryInfo deepCopy() {
335
  public UserPrimaryInfo deepCopy() {
316
    return new UserPrimaryInfo(this);
336
    return new UserPrimaryInfo(this);
317
  }
337
  }
Line 801... Line 821...
801
    if (!value) {
821
    if (!value) {
802
      this.hintAnswer = null;
822
      this.hintAnswer = null;
803
    }
823
    }
804
  }
824
  }
805
 
825
 
-
 
826
  public long getDefaultAddressId() {
-
 
827
    return this.defaultAddressId;
-
 
828
  }
-
 
829
 
-
 
830
  public UserPrimaryInfo setDefaultAddressId(long defaultAddressId) {
-
 
831
    this.defaultAddressId = defaultAddressId;
-
 
832
    setDefaultAddressIdIsSet(true);
-
 
833
    return this;
-
 
834
  }
-
 
835
 
-
 
836
  public void unsetDefaultAddressId() {
-
 
837
    __isset_bit_vector.clear(__DEFAULTADDRESSID_ISSET_ID);
-
 
838
  }
-
 
839
 
-
 
840
  /** Returns true if field defaultAddressId is set (has been asigned a value) and false otherwise */
-
 
841
  public boolean isSetDefaultAddressId() {
-
 
842
    return __isset_bit_vector.get(__DEFAULTADDRESSID_ISSET_ID);
-
 
843
  }
-
 
844
 
-
 
845
  public void setDefaultAddressIdIsSet(boolean value) {
-
 
846
    __isset_bit_vector.set(__DEFAULTADDRESSID_ISSET_ID, value);
-
 
847
  }
-
 
848
 
-
 
849
  public String getCommunicationEmail() {
-
 
850
    return this.communicationEmail;
-
 
851
  }
-
 
852
 
-
 
853
  public UserPrimaryInfo setCommunicationEmail(String communicationEmail) {
-
 
854
    this.communicationEmail = communicationEmail;
-
 
855
    return this;
-
 
856
  }
-
 
857
 
-
 
858
  public void unsetCommunicationEmail() {
-
 
859
    this.communicationEmail = null;
-
 
860
  }
-
 
861
 
-
 
862
  /** Returns true if field communicationEmail is set (has been asigned a value) and false otherwise */
-
 
863
  public boolean isSetCommunicationEmail() {
-
 
864
    return this.communicationEmail != null;
-
 
865
  }
-
 
866
 
-
 
867
  public void setCommunicationEmailIsSet(boolean value) {
-
 
868
    if (!value) {
-
 
869
      this.communicationEmail = null;
-
 
870
    }
-
 
871
  }
-
 
872
 
806
  public void setFieldValue(_Fields field, Object value) {
873
  public void setFieldValue(_Fields field, Object value) {
807
    switch (field) {
874
    switch (field) {
808
    case USER_ID:
875
    case USER_ID:
809
      if (value == null) {
876
      if (value == null) {
810
        unsetUserId();
877
        unsetUserId();
Line 955... Line 1022...
955
      } else {
1022
      } else {
956
        setHintAnswer((String)value);
1023
        setHintAnswer((String)value);
957
      }
1024
      }
958
      break;
1025
      break;
959
 
1026
 
-
 
1027
    case DEFAULT_ADDRESS_ID:
-
 
1028
      if (value == null) {
-
 
1029
        unsetDefaultAddressId();
-
 
1030
      } else {
-
 
1031
        setDefaultAddressId((Long)value);
-
 
1032
      }
-
 
1033
      break;
-
 
1034
 
-
 
1035
    case COMMUNICATION_EMAIL:
-
 
1036
      if (value == null) {
-
 
1037
        unsetCommunicationEmail();
-
 
1038
      } else {
-
 
1039
        setCommunicationEmail((String)value);
-
 
1040
      }
-
 
1041
      break;
-
 
1042
 
960
    }
1043
    }
961
  }
1044
  }
962
 
1045
 
963
  public void setFieldValue(int fieldID, Object value) {
1046
  public void setFieldValue(int fieldID, Object value) {
964
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1047
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 1021... Line 1104...
1021
      return getHintQuestion();
1104
      return getHintQuestion();
1022
 
1105
 
1023
    case HINT_ANSWER:
1106
    case HINT_ANSWER:
1024
      return getHintAnswer();
1107
      return getHintAnswer();
1025
 
1108
 
-
 
1109
    case DEFAULT_ADDRESS_ID:
-
 
1110
      return new Long(getDefaultAddressId());
-
 
1111
 
-
 
1112
    case COMMUNICATION_EMAIL:
-
 
1113
      return getCommunicationEmail();
-
 
1114
 
1026
    }
1115
    }
1027
    throw new IllegalStateException();
1116
    throw new IllegalStateException();
1028
  }
1117
  }
1029
 
1118
 
1030
  public Object getFieldValue(int fieldId) {
1119
  public Object getFieldValue(int fieldId) {
Line 1070... Line 1159...
1070
      return isSetOccupation();
1159
      return isSetOccupation();
1071
    case HINT_QUESTION:
1160
    case HINT_QUESTION:
1072
      return isSetHintQuestion();
1161
      return isSetHintQuestion();
1073
    case HINT_ANSWER:
1162
    case HINT_ANSWER:
1074
      return isSetHintAnswer();
1163
      return isSetHintAnswer();
-
 
1164
    case DEFAULT_ADDRESS_ID:
-
 
1165
      return isSetDefaultAddressId();
-
 
1166
    case COMMUNICATION_EMAIL:
-
 
1167
      return isSetCommunicationEmail();
1075
    }
1168
    }
1076
    throw new IllegalStateException();
1169
    throw new IllegalStateException();
1077
  }
1170
  }
1078
 
1171
 
1079
  public boolean isSet(int fieldID) {
1172
  public boolean isSet(int fieldID) {
Line 1262... Line 1355...
1262
        return false;
1355
        return false;
1263
      if (!this.hintAnswer.equals(that.hintAnswer))
1356
      if (!this.hintAnswer.equals(that.hintAnswer))
1264
        return false;
1357
        return false;
1265
    }
1358
    }
1266
 
1359
 
-
 
1360
    boolean this_present_defaultAddressId = true;
-
 
1361
    boolean that_present_defaultAddressId = true;
-
 
1362
    if (this_present_defaultAddressId || that_present_defaultAddressId) {
-
 
1363
      if (!(this_present_defaultAddressId && that_present_defaultAddressId))
-
 
1364
        return false;
-
 
1365
      if (this.defaultAddressId != that.defaultAddressId)
-
 
1366
        return false;
-
 
1367
    }
-
 
1368
 
-
 
1369
    boolean this_present_communicationEmail = true && this.isSetCommunicationEmail();
-
 
1370
    boolean that_present_communicationEmail = true && that.isSetCommunicationEmail();
-
 
1371
    if (this_present_communicationEmail || that_present_communicationEmail) {
-
 
1372
      if (!(this_present_communicationEmail && that_present_communicationEmail))
-
 
1373
        return false;
-
 
1374
      if (!this.communicationEmail.equals(that.communicationEmail))
-
 
1375
        return false;
-
 
1376
    }
-
 
1377
 
1267
    return true;
1378
    return true;
1268
  }
1379
  }
1269
 
1380
 
1270
  @Override
1381
  @Override
1271
  public int hashCode() {
1382
  public int hashCode() {
Line 1444... Line 1555...
1444
              this.hintAnswer = iprot.readString();
1555
              this.hintAnswer = iprot.readString();
1445
            } else { 
1556
            } else { 
1446
              TProtocolUtil.skip(iprot, field.type);
1557
              TProtocolUtil.skip(iprot, field.type);
1447
            }
1558
            }
1448
            break;
1559
            break;
-
 
1560
          case DEFAULT_ADDRESS_ID:
-
 
1561
            if (field.type == TType.I64) {
-
 
1562
              this.defaultAddressId = iprot.readI64();
-
 
1563
              setDefaultAddressIdIsSet(true);
-
 
1564
            } else { 
-
 
1565
              TProtocolUtil.skip(iprot, field.type);
-
 
1566
            }
-
 
1567
            break;
-
 
1568
          case COMMUNICATION_EMAIL:
-
 
1569
            if (field.type == TType.STRING) {
-
 
1570
              this.communicationEmail = iprot.readString();
-
 
1571
            } else { 
-
 
1572
              TProtocolUtil.skip(iprot, field.type);
-
 
1573
            }
-
 
1574
            break;
1449
        }
1575
        }
1450
        iprot.readFieldEnd();
1576
        iprot.readFieldEnd();
1451
      }
1577
      }
1452
    }
1578
    }
1453
    iprot.readStructEnd();
1579
    iprot.readStructEnd();
Line 1557... Line 1683...
1557
    if (this.hintAnswer != null) {
1683
    if (this.hintAnswer != null) {
1558
      oprot.writeFieldBegin(HINT_ANSWER_FIELD_DESC);
1684
      oprot.writeFieldBegin(HINT_ANSWER_FIELD_DESC);
1559
      oprot.writeString(this.hintAnswer);
1685
      oprot.writeString(this.hintAnswer);
1560
      oprot.writeFieldEnd();
1686
      oprot.writeFieldEnd();
1561
    }
1687
    }
-
 
1688
    oprot.writeFieldBegin(DEFAULT_ADDRESS_ID_FIELD_DESC);
-
 
1689
    oprot.writeI64(this.defaultAddressId);
-
 
1690
    oprot.writeFieldEnd();
-
 
1691
    if (this.communicationEmail != null) {
-
 
1692
      oprot.writeFieldBegin(COMMUNICATION_EMAIL_FIELD_DESC);
-
 
1693
      oprot.writeString(this.communicationEmail);
-
 
1694
      oprot.writeFieldEnd();
-
 
1695
    }
1562
    oprot.writeFieldStop();
1696
    oprot.writeFieldStop();
1563
    oprot.writeStructEnd();
1697
    oprot.writeStructEnd();
1564
  }
1698
  }
1565
 
1699
 
1566
  @Override
1700
  @Override
Line 1701... Line 1835...
1701
      sb.append("null");
1835
      sb.append("null");
1702
    } else {
1836
    } else {
1703
      sb.append(this.hintAnswer);
1837
      sb.append(this.hintAnswer);
1704
    }
1838
    }
1705
    first = false;
1839
    first = false;
-
 
1840
    if (!first) sb.append(", ");
-
 
1841
    sb.append("defaultAddressId:");
-
 
1842
    sb.append(this.defaultAddressId);
-
 
1843
    first = false;
-
 
1844
    if (!first) sb.append(", ");
-
 
1845
    sb.append("communicationEmail:");
-
 
1846
    if (this.communicationEmail == null) {
-
 
1847
      sb.append("null");
-
 
1848
    } else {
-
 
1849
      sb.append(this.communicationEmail);
-
 
1850
    }
-
 
1851
    first = false;
1706
    sb.append(")");
1852
    sb.append(")");
1707
    return sb.toString();
1853
    return sb.toString();
1708
  }
1854
  }
1709
 
1855
 
1710
  public void validate() throws TException {
1856
  public void validate() throws TException {