From: Roland Haeder Date: Thu, 6 Aug 2015 12:03:42 +0000 (+0200) Subject: Made all data-setter public, Gender is fine to be set publicly. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7ac728480582ced27e0324f7804b23e9adb9bae3;p=jcore.git Made all data-setter public, Gender is fine to be set publicly. Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/jcore/contact/BaseContact.java b/src/org/mxchange/jcore/contact/BaseContact.java index a30dcc5..7b5b1c6 100644 --- a/src/org/mxchange/jcore/contact/BaseContact.java +++ b/src/org/mxchange/jcore/contact/BaseContact.java @@ -177,7 +177,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param city the city to set */ - private void setCity (final String city) { + @Override + public final void setCity (final String city) { this.city = city; } @@ -196,7 +197,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param comment the comment to set */ - private void setComment (final String comment) { + @Override + public final void setComment (final String comment) { this.comment = comment; } @@ -215,7 +217,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param companyName the companyName to set */ - private void setCompanyName (final String companyName) { + @Override + public final void setCompanyName (final String companyName) { this.companyName = companyName; } @@ -234,7 +237,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param countryCode the countryCode to set */ - private void setCountryCode (final String countryCode) { + @Override + public final void setCountryCode (final String countryCode) { this.countryCode = countryCode; } @@ -288,7 +292,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param emailAddress the emailAddress to set */ - private void setEmailAddress (final String emailAddress) { + @Override + public final void setEmailAddress (final String emailAddress) { this.emailAddress = emailAddress; } @@ -307,7 +312,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param familyName the familyName to set */ - private void setFamilyName (final String familyName) { + @Override + public final void setFamilyName (final String familyName) { this.familyName = familyName; } @@ -326,7 +332,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param faxNumber the faxNumber to set */ - private void setFaxNumber (final String faxNumber) { + @Override + public final void setFaxNumber (final String faxNumber) { this.faxNumber = faxNumber; } @@ -345,7 +352,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param gender the gender to set */ - private void setGender (final Gender gender) { + @Override + public final void setGender (final Gender gender) { this.gender = gender; } @@ -384,7 +392,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param street the street to set */ - protected final void setStreet (final String street) { + @Override + public final void setStreet (final String street) { this.street = street; } @@ -427,10 +436,11 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param zipCode the zipCode to set */ - protected final void setZipCode (final long zipCode) { + @Override + public final void setZipCode (final long zipCode) { this.zipCode = zipCode; } - + @Override public int hashCode () { // Validate gender instance @@ -479,106 +489,6 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { client.displayOtherDataBox(this); } - /** - * Updates address data in this Contact instance - * - * @param street Street - * @param zipCode ZIP code - * @param city City - * @param countryCode Country code - */ - @Override - public void updateAddressData (final String street, final long zipCode, final String city, final String countryCode) { - // Trace message - this.getLogger().trace(MessageFormat.format("street={0},zipCode={1},city={2},countryCode={3} - CALLED!", street, zipCode, city, countryCode)); //NOI18N - - // Set all - if (street != null) { - this.setStreet(street); - } - if (zipCode > 0) { - this.setZipCode(zipCode); - } - if (city != null) { - this.setCity(city); - } - if (countryCode != null) { - this.setCountryCode(countryCode); - } - - // Trace message - this.getLogger().trace("EXIT!"); //NOI18N - } - - /** - * Updates name data in this Contact instance - * - * @param gender Gender (M, F, C) - * @param surname Surname - * @param familyName Family name - * @param companyName Company name - */ - @Override - public void updateNameData (final Gender gender, final String surname, final String familyName, final String companyName) { - // Trace message - this.getLogger().trace(MessageFormat.format("gender={0},surname={1},familyName={2},companyName={3} - CALLED!", gender, surname, familyName, companyName)); //NOI18N - - // Set all - this.setGender(gender); - - if (surname != null) { - this.setSurname(surname); - } - if (familyName != null) { - this.setFamilyName(familyName); - } - if (companyName != null) { - this.setCompanyName(companyName); - } - - // Trace message - this.getLogger().trace("EXIT!"); //NOI18N - } - - /** - * Updates other data in this Contact instance - * - * @param phoneNumber Phone number - * @param cellphoneNumber Cellphone number - * @param faxNumber Fax number - * @param emailAddress Email address - * @param birthday Birth day - * @param comment Comments - */ - @Override - public void updateOtherData (final String phoneNumber, final String cellphoneNumber, final String faxNumber, final String emailAddress, final String birthday, final String comment) { - // Trace message - this.getLogger().trace(MessageFormat.format("phoneNumber={0},cellphoneNumber={1}faxNumber={2},emailAddress={3},birthday={4},comment={5} - CALLED!", phoneNumber, cellphoneNumber, faxNumber, emailAddress, birthday, comment)); //NOI18N - - // Set all - if (phoneNumber != null) { - this.setPhoneNumber(phoneNumber); - } - if (cellphoneNumber != null) { - this.setCellphoneNumber(cellphoneNumber); - } - if (faxNumber != null) { - this.setFaxNumber(faxNumber); - } - if (emailAddress != null) { - this.setEmailAddress(emailAddress); - } - if (birthday != null) { - this.setBirthday(birthday); - } - if (comment != null) { - this.setComment(comment); - } - - // Trace message - this.getLogger().trace("EXIT!"); //NOI18N - } - /** * Enables the flag "own data" which signals that this contact is the user's * own data. @@ -592,7 +502,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param surname the surname to set */ - protected final void setSurname (final String surname) { + @Override + public final void setSurname (final String surname) { this.surname = surname; } @@ -601,7 +512,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param phoneNumber the phoneNumber to set */ - protected final void setPhoneNumber (final String phoneNumber) { + @Override + public final void setPhoneNumber (final String phoneNumber) { this.phoneNumber = phoneNumber; } @@ -610,7 +522,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param houseNumber the houseNumber to set */ - protected final void setHouseNumber (final int houseNumber) { + public final void setHouseNumber (final int houseNumber) { this.houseNumber = houseNumber; } @@ -619,7 +531,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param cellphoneNumber the cellphoneNumber to set */ - protected final void setCellphoneNumber (final String cellphoneNumber) { + @Override + public final void setCellphoneNumber (final String cellphoneNumber) { this.cellphoneNumber = cellphoneNumber; } @@ -628,7 +541,8 @@ public class BaseContact extends BaseFrameworkSystem implements Contact { * * @param birthday the birthday to set */ - protected final void setBirthday (final String birthday) { + @Override + public final void setBirthday (final String birthday) { this.birthday = birthday; } diff --git a/src/org/mxchange/jcore/contact/Contact.java b/src/org/mxchange/jcore/contact/Contact.java index ba1ddd6..2760dac 100644 --- a/src/org/mxchange/jcore/contact/Contact.java +++ b/src/org/mxchange/jcore/contact/Contact.java @@ -46,6 +46,13 @@ public interface Contact extends FrameworkInterface { */ public Gender getGender (); + /** + * Gender of the contact + * + * @param gender the gender to set + */ + public void setGender (final Gender gender); + /** * Surname * @@ -53,6 +60,13 @@ public interface Contact extends FrameworkInterface { */ public String getSurname (); + /** + * Surname + * + * @param surname the surname to set + */ + public void setSurname (final String surname); + /** * Family name * @@ -60,6 +74,13 @@ public interface Contact extends FrameworkInterface { */ public String getFamilyName (); + /** + * Family name + * + * @param familyName the familyName to set + */ + public void setFamilyName (final String familyName); + /** * Companyname * @@ -67,6 +88,13 @@ public interface Contact extends FrameworkInterface { */ public String getCompanyName (); + /** + * Companyname + * + * @param companyName the companyName to set + */ + public void setCompanyName (final String companyName); + /** * Street * @@ -74,6 +102,13 @@ public interface Contact extends FrameworkInterface { */ public String getStreet (); + /** + * Street + * + * @param street the street to set + */ + public void setStreet (final String street); + /** * House number * @@ -88,6 +123,13 @@ public interface Contact extends FrameworkInterface { */ public long getZipCode (); + /** + * ZIP code + * + * @param zipCode the zipCode to set + */ + public void setZipCode (final long zipCode); + /** * City * @@ -95,6 +137,13 @@ public interface Contact extends FrameworkInterface { */ public String getCity (); + /** + * City + * + * @param city the city to set + */ + public void setCity (final String city); + /** * Country code * @@ -102,6 +151,13 @@ public interface Contact extends FrameworkInterface { */ public String getCountryCode (); + /** + * Country code + * + * @param countryCode the countryCode to set + */ + public void setCountryCode (final String countryCode); + /** * Email address * @@ -109,6 +165,13 @@ public interface Contact extends FrameworkInterface { */ public String getEmailAddress (); + /** + * Email address + * + * @param emailAddress the emailAddress to set + */ + public void setEmailAddress (final String emailAddress); + /** * Phone number * @@ -116,6 +179,13 @@ public interface Contact extends FrameworkInterface { */ public String getPhoneNumber (); + /** + * Phone number + * + * @param phoneNumber the phoneNumber to set + */ + public void setPhoneNumber (final String phoneNumber); + /** * Fax number * @@ -124,71 +194,58 @@ public interface Contact extends FrameworkInterface { public String getFaxNumber (); /** - * Cellphone number + * Fax number * - * @return the cellphoneNumber + * @param faxNumber the faxNumber to set */ - public String getCellphoneNumber (); + public void setFaxNumber (final String faxNumber); /** - * Birth day + * Cellphone number * - * @return the birthday + * @return the cellphoneNumber */ - public String getBirthday (); + public String getCellphoneNumber (); /** - * Comments + * Cellphone number * - * @return the comment + * @param cellphoneNumber the cellphoneNumber to set */ - public String getComment (); + public void setCellphoneNumber (final String cellphoneNumber); /** - * Checks if given boolean value is available and set to same value + * Birth day * - * @param columnName Column name to check - * @param bool Boolean value - * @return Whether all conditions are met + * @return the birthday */ - public boolean isValueEqual (final String columnName, final boolean bool); + public String getBirthday (); /** - * Shows the contact to the user + * Birth day * - * @param client Client instance to call back + * @param birthday the birthday to set */ - public void show (final Client client); + public void setBirthday (final String birthday); /** - * Updates address data in this Contact instance + * Comments * - * @param street Street - * @param zipCode ZIP code - * @param city City - * @param countryCode Country code + * @return the comment */ - public void updateAddressData (final String street, final long zipCode, final String city, final String countryCode); + public String getComment (); /** - * Updates name data in this Contact instance + * Comments * - * @param gender Gender (M, F, C) - * @param surname Surname - * @param familyName Family name - * @param companyName Company name + * @param comment the comment to set */ - public void updateNameData (final Gender gender, final String surname, final String familyName, final String companyName); + public void setComment (final String comment); /** - * Updates other data in this Contact instance + * Shows the contact to the user * - * @param phoneNumber Phone number - * @param cellNumber Cellphone number - * @param faxNumber Fax number - * @param email Email address - * @param birthday Birthday - * @param comment Comments + * @param client Client instance to call back */ - public void updateOtherData (final String phoneNumber, final String cellNumber, final String faxNumber, final String email, final String birthday, final String comment); + public void show (final Client client); }