/**\r
* ZIP code\r
*/\r
- private int zipCode;\r
+ private long zipCode;\r
\r
/**\r
* No instances can be created of this class\r
super();\r
}\r
\r
- /**\r
- * Enables the flag "own data" which signals that this contact is the user's\r
- * own data.\r
- */\r
- public void enableFlagOwnContact () {\r
- this.ownContact = true;\r
- }\r
-\r
/**\r
* Check if contacts are same or throw an exception\r
*\r
this.countryCode = countryCode;\r
}\r
\r
+ /**\r
+ * "Serializes" this object into a CSV string (this time with semicolons)\r
+ *\r
+ * @return "CSV-serialized" version of the stored data\r
+ */\r
+ public String getCsvStringFromStoreableObject () {\r
+ // Get all together\r
+ String csvString = String.format(\r
+ "\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\"\n",\r
+ this.isOwnContact(),\r
+ this.getGender(),\r
+ this.getSurname(),\r
+ this.getFamilyName(),\r
+ this.getCompanyName(),\r
+ this.getStreet(),\r
+ this.getZipCode(),\r
+ this.getCity(),\r
+ this.getCountryCode(),\r
+ this.getPhoneNumber(),\r
+ this.getFaxNumber(),\r
+ this.getCellphoneNumber(),\r
+ this.getEmailAddress(),\r
+ this.getBirthday(),\r
+ this.getComment()\r
+ );\r
+ \r
+ // Then return it\r
+ return csvString;\r
+ }\r
+\r
/**\r
* Email address\r
*\r
*\r
* @return the zipCode\r
*/\r
- public int getZipCode () {\r
+ public long getZipCode () {\r
return this.zipCode;\r
}\r
\r
*\r
* @param zipCode the zipCode to set\r
*/\r
- public void setZipCode (final int zipCode) {\r
+ public void setZipCode (final long zipCode) {\r
this.zipCode = zipCode;\r
}\r
\r
* @param city City\r
* @param countryCode Country code\r
*/\r
- public void updateAddressData (final String street, final int zipCode, final String city, final String countryCode) {\r
+ public void updateAddressData (final String street, final long zipCode, final String city, final String countryCode) {\r
// Set all\r
- this.setStreet(street);\r
- this.setZipCode(zipCode);\r
- this.setCity(city);\r
- this.setCountryCode(countryCode);\r
+ if (street != null) {\r
+ this.setStreet(street);\r
+ }\r
+ if (zipCode > 0) {\r
+ this.setZipCode(zipCode);\r
+ }\r
+ if (city != null) {\r
+ this.setCity(city);\r
+ }\r
+ if (countryCode != null) {\r
+ this.setCountryCode(countryCode);\r
+ }\r
}\r
\r
/**\r
public void updateNameData (final char gender, final String surname, final String familyName, final String companyName) {\r
// Set all\r
this.setGender(gender);\r
- this.setSurname(surname);\r
- this.setFamilyName(familyName);\r
- this.setCompanyName(companyName);\r
+ if (surname != null) {\r
+ this.setSurname(surname);\r
+ }\r
+ if (familyName != null) {\r
+ this.setFamilyName(familyName);\r
+ }\r
+ if (companyName != null) {\r
+ this.setCompanyName(companyName);\r
+ }\r
}\r
\r
/**\r
* @param cellphoneNumber Cellphone number\r
* @param faxNumber Fax number\r
* @param emailAddress Email address\r
+ * @param birthday Birth day\r
* @param comment Comments\r
*/\r
- public void updateOtherData (final String phoneNumber, final String cellphoneNumber, final String faxNumber, final String emailAddress, final String comment) {\r
+ public void updateOtherData (final String phoneNumber, final String cellphoneNumber, final String faxNumber, final String emailAddress, final String birthday, final String comment) {\r
// Set all\r
- this.setPhoneNumber(phoneNumber);\r
- this.setCellphoneNumber(cellphoneNumber);\r
- this.setFaxNumber(faxNumber);\r
- this.setEmailAddress(emailAddress);\r
- this.setComment(comment);\r
+ if (phoneNumber != null) {\r
+ this.setPhoneNumber(phoneNumber);\r
+ }\r
+ if (cellphoneNumber != null) {\r
+ this.setCellphoneNumber(cellphoneNumber);\r
+ }\r
+ if (faxNumber != null) {\r
+ this.setFaxNumber(faxNumber);\r
+ }\r
+ if (emailAddress != null) {\r
+ this.setEmailAddress(emailAddress);\r
+ }\r
+ if (birthday != null) {\r
+ this.setBirthday(birthday);\r
+ }\r
+ if (comment != null) {\r
+ this.setComment(comment);\r
+ }\r
}\r
\r
/**\r
- * "Serializes" this object into a CSV string (this time with semicolons)\r
- * \r
- * @return "CSV-serialized" version of the stored data\r
+ * Enables the flag "own data" which signals that this contact is the user's\r
+ * own data.\r
*/\r
- public String getCsvStringFromStoreableObject () {\r
- // Get all together\r
- String csvString = String.format(\r
- "\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\";\"%s\"\n",\r
- this.isOwnContact(),\r
- this.getGender(),\r
- this.getSurname(),\r
- this.getFamilyName(),\r
- this.getCompanyName(),\r
- this.getStreet(),\r
- this.getZipCode(),\r
- this.getCity(),\r
- this.getCountryCode(),\r
- this.getPhoneNumber(),\r
- this.getFaxNumber(),\r
- this.getCellphoneNumber(),\r
- this.getEmailAddress(),\r
- this.getBirthday(),\r
- this.getComment()\r
- );\r
-\r
- // Then return it\r
- return csvString;\r
+ protected void enableFlagOwnContact () {\r
+ this.ownContact = true;\r
}\r
}\r