From ad792e6206ae5867be6ac6dcbb8870f3f0d5538d Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 13:48:18 +0200 Subject: [PATCH] =?utf8?q?Rewrite:=20-=20renamed=20almost=20all=20fields?= =?utf8?q?=20-=20made=20Country=20transient=20as=20this=20one=20should=20n?= =?utf8?q?ot=20be=20entered=20by=20the=20user=20-=20fixed=20index=20-=20up?= =?utf8?q?dated=20jar(s)=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jphone-core.jar | Bin 19613 -> 19729 bytes .../mxchange/jcontacts/contact/Contact.java | 66 ++--- .../jcontacts/contact/UserContact.java | 273 +++++++++--------- .../jcontacts/contact/gender/GenderUtils.java | 4 +- .../ContactAlreadyAddedException.java | 2 +- 5 files changed, 172 insertions(+), 173 deletions(-) diff --git a/lib/jphone-core.jar b/lib/jphone-core.jar index b8dca2dabf7a76459a987f1aa219cbae8f80a21f..414efac950081166b94266e38fee672969ff647f 100644 GIT binary patch delta 4590 zcmcIoNo-rk8UEj+$Va{~k}4~dVaXO{TB5a68)Yq)C`%-@S(X=B))rfmY0GvJiI(HS zDN;pv# zk1Cm{1xkRk|I5t$-#0Vw{*SeLKheCCV~zro$W3%7dCyy`e?NJz^G7<$PyC#IRf|;Y z*Fv0~(2jC;SBrD@sW!mbK0U_Sl0L%OJ9-bY)SvV<{abgEFK;-($kdike4oTa@n92H(fEQfUa`=nwy?;)AI(sV4}8a(3(L> zgRZB(bl%ck&P$0K%PV3l>??_J>CCOQM2|+!=s-MrO8hg}kb2~P&G}RZ^?B(KRePyb z3=}RnI%r*N75>~cP3JV~76ZO|>C&r34_2BARGo+D^hz_9EhO+FhAO~w{r^*rXD^-Q)>!2{wPI0H$A3p+_5~wE{ zM|zw*G(m-Qg1XS+hd5CYbyE*=F7;A1B)N1H7IjEqUQ$;mDFUsX7}JiNb(tSf!AyzsF}XfOO()jkl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?gco&#Ptrd6;US7}QMdk|tJ`6Tu%^QagEL&dc zY+CNr3b?^rGmv&5E15=^X}Deh@pI zG`huGb(O&lhVK&N^jcYwb~HY%ykH;y2Q(g2ZlU~tp>YV=$kFqWZsnpv?WHipF(71q6pz)+U!?|HcV|2uMqp;)v-YW;h^^Vz^C6f$# z#tnSUa52lp92fHjEf{ptphXF@fzEd{-H3^IeJ8}R;CCN=I$Rly#7}nb*PQ11+Kb}2 zqupt4qw$~04)MuAe*Et}1)8IsI^xbFr?eeDCL0iR**4C!gG*F_gUmrqF`S(^G%Kh@ z9+LsQ5!x_0HzovCl%4ozCF*U`)J2u?sZOhAc@ilNqhoEc4@B(7k$`V5j-iAC=^)Bg@BxSk0oYAE^bUP(U zSzf*XFJH{!MIDJcAkPUtO8ZcA<}i?vISQk)5k=1=awd$|pv)?qjN3Gwp7@g=mHns@ z*X~9gPeeX{T1CD)PrMOziPu7Z%$TCB(M_2OGUiV^PY^92OhJJWMT*sY` zzfsIM`MbIIX^FTW_KL8ckH>elST1!5bKJv5%f~D9zj{-n(aKV>HC`mmrQMs8wou>P zd!jt0psvzN;Wxhx4*wnk{6*3f{&YB@;1w+sK50GeNKX^?)k)#qIzI<_h-a2!9TAReFY5i{Q-RYMG&xZWM7xhTtnCpIc7gu8bm^YKZn|sq?2=|G9MfbUU H!`%H}c&k5) diff --git a/src/org/mxchange/jcontacts/contact/Contact.java b/src/org/mxchange/jcontacts/contact/Contact.java index 9eb87a1..75c6e6c 100644 --- a/src/org/mxchange/jcontacts/contact/Contact.java +++ b/src/org/mxchange/jcontacts/contact/Contact.java @@ -44,56 +44,56 @@ public interface Contact extends Serializable { *

* @return the birthday */ - public Date getBirthday (); + public Date getContactBirthday (); /** * Birth day *

* @param birthday the birthday to set */ - public void setBirthday (final Date birthday); + public void setContactBirthday (final Date birthday); /** * Getter for cellphone number *

* @return Cellphone number */ - public DialableCellphoneNumber getCellphoneNumber (); + public DialableCellphoneNumber getContactCellphoneNumber (); /** * Setter for cellphone number *

* @param cellphoneNumber Cellphone number */ - public void setCellphoneNumber (final DialableCellphoneNumber cellphoneNumber); + public void setContactCellphoneNumber (final DialableCellphoneNumber cellphoneNumber); /** * City *

* @return the city */ - public String getCity (); + public String getContactCity (); /** * City *

* @param city the city to set */ - public void setCity (final String city); + public void setContactCity (final String city); /** * Comments *

* @return the comment */ - public String getComment (); + public String getContactComment (); /** * Comments *

* @param comment the comment to set */ - public void setComment (final String comment); + public void setContactComment (final String comment); /** * Id number @@ -114,175 +114,175 @@ public interface Contact extends Serializable { *

* @return the countryCode */ - public Country getCountry (); + public Country getContactCountry (); /** * Country code *

* @param contactCountry the countryCode to set */ - public void setCountry (final Country contactCountry); + public void setContactCountry (final Country contactCountry); /** * Getter for "created" timestamp *

* @return "created" timestamp */ - public Calendar getCreated (); + public Calendar getContactCreated (); /** * Setter for "created" timestamp *

* @param created "created" timestamp */ - public void setCreated (final Calendar created); + public void setContactCreated (final Calendar created); /** * Email address *

* @return the emailAddress */ - public String getEmailAddress (); + public String getContactEmailAddress (); /** * Email address *

* @param emailAddress the emailAddress to set */ - public void setEmailAddress (final String emailAddress); + public void setContactEmailAddress (final String emailAddress); /** * Family name *

* @return the familyName */ - public String getFamilyName (); + public String getContactFamilyName (); /** * Family name *

* @param familyName the familyName to set */ - public void setFamilyName (final String familyName); + public void setContactFamilyName (final String familyName); /** * Fax number *

* @return the faxNumber */ - public DialableFaxNumber getFaxNumber (); + public DialableFaxNumber getContactFaxNumber (); /** * Fax number *

* @param faxNumber the faxNumber to set */ - public void setFaxNumber (final DialableFaxNumber faxNumber); + public void setContactFaxNumber (final DialableFaxNumber faxNumber); /** * First name *

* @return the first name */ - public String getFirstName (); + public String getContactFirstName (); /** * First name *

* @param firstName the first name to set */ - public void setFirstName (final String firstName); + public void setContactFirstName (final String firstName); /** * Gender of the contact *

* @return the gender */ - public Gender getGender (); + public Gender getContactGender (); /** * Gender of the contact *

* @param gender the gender to set */ - public void setGender (final Gender gender); + public void setContactGender (final Gender gender); /** * House number *

* @return the houseNumber */ - public Short getHouseNumber (); + public Short getContactHouseNumber (); /** * House number *

* @param houseNumber the houseNumber to set */ - public void setHouseNumber (final Short houseNumber); + public void setContactHouseNumber (final Short houseNumber); /** * Setter for own contact *

* @param ownContact Own contact */ - public void setOwnContact (final Boolean ownContact); + public void setContactOwnContact (final Boolean ownContact); /** * Getter for phone number *

* @return Phone number */ - public DialableLandLineNumber getPhoneNumber (); + public DialableLandLineNumber getContactPhoneNumber (); /** * Setter for phone number *

* @param phoneNumber Phone number */ - public void setPhoneNumber (final DialableLandLineNumber phoneNumber); + public void setContactPhoneNumber (final DialableLandLineNumber phoneNumber); /** * Street *

* @return the street */ - public String getStreet (); + public String getContactStreet (); /** * Street *

* @param street the street to set */ - public void setStreet (final String street); + public void setContactStreet (final String street); /** * Getter for "updated" timestamp *

* @return "updated" timestamp */ - public Calendar getUpdated (); + public Calendar getContactUpdated (); /** * Getter for "updated" timestamp *

* @param updated "updated" timestamp */ - public void setUpdated (final Calendar updated); + public void setContactUpdated (final Calendar updated); /** * ZIP code *

* @return the zipCode */ - public Integer getZipCode (); + public Integer getContactZipCode (); /** * ZIP code *

* @param zipCode the zipCode to set */ - public void setZipCode (final Integer zipCode); + public void setContactZipCode (final Integer zipCode); /** * Checks whether the contact is user's own data diff --git a/src/org/mxchange/jcontacts/contact/UserContact.java b/src/org/mxchange/jcontacts/contact/UserContact.java index d0dd336..20b6fdf 100644 --- a/src/org/mxchange/jcontacts/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/contact/UserContact.java @@ -26,6 +26,7 @@ import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; +import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @@ -36,7 +37,6 @@ import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import javax.persistence.Transient; import org.mxchange.jcontacts.contact.gender.Gender; import org.mxchange.jcountry.data.Country; import org.mxchange.jcountry.data.CountryData; @@ -58,8 +58,8 @@ import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; name = "contacts", indexes = { @Index ( - name = "gender", - columnList = "gender" + name = "contact_gender", + columnList = "contact_gender" ) } ) @@ -73,29 +73,29 @@ public class UserContact implements Contact, Comparable { /** * Birth day */ - @Column (name = "birthday") + @Column (name = "contact_birthday") @Temporal (TemporalType.DATE) - private Date birthday; + private Date contactBirthday; /** * Cellphone number */ - @JoinColumn (name = "cellphone_number_id") + @JoinColumn (name = "contact_cellphone_number_id") @OneToOne (targetEntity = CellphoneNumber.class, cascade = CascadeType.ALL) - private DialableCellphoneNumber cellphoneNumber; + private DialableCellphoneNumber contactCellphoneNumber; /** * City */ - @Column (name = "city", nullable = false, length = 100) - private String city; + @Column (name = "contact_city", nullable = false, length = 100) + private String contactCity; /** * Optional comments */ @Lob - @Column (name = "comment") - private String comment; + @Column (name = "contact_comment") + private String contactComment; /** * Id number @@ -109,103 +109,102 @@ public class UserContact implements Contact, Comparable { * Country code */ @JoinColumn (name = "contact_country_id", nullable = false) - @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false) - @Transient - private Country country; + @OneToOne(targetEntity = CountryData.class, cascade = CascadeType.ALL, optional = false, fetch = FetchType.EAGER) + private Country contactCountry; /** * When the contact has been created */ @Basic (optional = false) @Temporal (TemporalType.TIMESTAMP) - @Column (name = "created", nullable = false) - private Calendar created; + @Column (name = "contact_created", nullable = false) + private Calendar contactCreated; /** * Email address */ - @Column (name = "email_address", length = 100, nullable = false) - private String emailAddress; + @Column (name = "contact_email_address", length = 100, nullable = false) + private String contactEmailAddress; /** * Family name */ @Basic (optional = false) - @Column (name = "family_name", length = 100, nullable = false) - private String familyName; + @Column (name = "contact_family_name", length = 100, nullable = false) + private String contactFamilyName; /** * Fax number */ - @JoinColumn (name = "fax_number_id") + @JoinColumn (name = "contact_fax_number_id") @OneToOne(targetEntity = FaxNumber.class,cascade = CascadeType.ALL) - private DialableFaxNumber faxNumber; + private DialableFaxNumber contactFaxNumber; /** * First name */ @Basic (optional = false) - @Column (name = "first_name", length = 100, nullable = false) - private String firstName; + @Column (name = "contact_first_name", length = 100, nullable = false) + private String contactFirstName; /** * Gender instance */ @Basic (optional = false) - @Column (name = "gender", nullable = false) + @Column (name = "contact_gender", nullable = false) @Enumerated (EnumType.STRING) - private Gender gender; + private Gender contactGender; /** * House number */ - @Column (name = "house_number", length = 5, nullable = false) - private Short houseNumber; + @Column (name = "contact_house_number", length = 5, nullable = false) + private Short contactHouseNumber; /** * Flag whether this contact is user's own data */ - @Column (name = "own_contact", nullable = false) - private Boolean ownContact; + @Column (name = "contact_own_contact", nullable = false) + private Boolean contactOwnContact; /** * Phone number */ - @JoinColumn (name = "phone_number_id") + @JoinColumn (name = "contact_phone_number_id") @OneToOne (targetEntity = LandLineNumber.class, cascade = CascadeType.ALL) - private DialableLandLineNumber phoneNumber; + private DialableLandLineNumber contactPhoneNumber; /** * Street */ - @Column (name = "street", nullable = false) - private String street; + @Column (name = "contact_street", nullable = false) + private String contactStreet; /** * When the contact has been updated */ @Temporal (TemporalType.TIMESTAMP) - @Column (name = "updated") - private Calendar updated; + @Column (name = "contact_updated") + private Calendar contactUpdated; /** * ZIP code */ - @Column (name = "zip_code", nullable = false, length = 6) - private Integer zipCode; + @Column (name = "contact_zip_code", nullable = false, length = 6) + private Integer contactZipCode; /** - * Constructor for gender and names + * Constructor for contactGender and names *

- * @param gender Gender instance - * @param firstName First name - * @param familyName Family name + * @param contactGender Gender instance + * @param contactFirstName First name + * @param contactFamilyName Family name */ - public UserContact (final Gender gender, final String firstName, final String familyName) { + public UserContact (final Gender contactGender, final String contactFirstName, final String contactFamilyName) { // Set all - this.gender = gender; - this.firstName = firstName; - this.familyName = familyName; + this.contactGender = contactGender; + this.contactFirstName = contactFirstName; + this.contactFamilyName = contactFamilyName; } /** @@ -245,23 +244,23 @@ public class UserContact implements Contact, Comparable { public void copyAll (final Contact contact) { // Copy all: // - base data - this.setFirstName(contact.getFirstName()); - this.setFamilyName(contact.getFamilyName()); - this.setStreet(contact.getStreet()); - this.setZipCode(contact.getZipCode()); - this.setCity(contact.getCity()); - this.setCountry(contact.getCountry()); + this.setContactFirstName(contact.getContactFirstName()); + this.setContactFamilyName(contact.getContactFamilyName()); + this.setContactStreet(contact.getContactStreet()); + this.setContactZipCode(contact.getContactZipCode()); + this.setContactCity(contact.getContactCity()); + this.setContactCountry(contact.getContactCountry()); // - phone, fax, email - this.setPhoneNumber(contact.getPhoneNumber()); - this.setFaxNumber(contact.getFaxNumber()); - this.setCellphoneNumber(contact.getCellphoneNumber()); + this.setContactPhoneNumber(contact.getContactPhoneNumber()); + this.setContactFaxNumber(contact.getContactFaxNumber()); + this.setContactCellphoneNumber(contact.getContactCellphoneNumber()); // - other data - this.setBirthday(contact.getBirthday()); - this.setComment(contact.getComment()); - this.setCreated(contact.getCreated()); - this.setUpdated(contact.getUpdated()); + this.setContactBirthday(contact.getContactBirthday()); + this.setContactComment(contact.getContactComment()); + this.setContactCreated(contact.getContactCreated()); + this.setContactUpdated(contact.getContactUpdated()); } /** @@ -286,49 +285,49 @@ public class UserContact implements Contact, Comparable { Contact contact = (Contact) object; // Now test some data TODO Definedly needs improvement - return ((this.getGender().equals(contact.getGender())) && - (this.getFirstName().toLowerCase().equals(contact.getFirstName().toLowerCase())) && - (this.getFamilyName().toLowerCase().equals(contact.getFamilyName().toLowerCase()))); + return ((this.getContactGender().equals(contact.getContactGender())) && + (this.getContactFirstName().toLowerCase().equals(contact.getContactFirstName().toLowerCase())) && + (this.getContactFamilyName().toLowerCase().equals(contact.getContactFamilyName().toLowerCase()))); } @Override - public Date getBirthday () { - return this.birthday; + public Date getContactBirthday () { + return this.contactBirthday; } @Override - public void setBirthday (final Date birthday) { - this.birthday = birthday; + public void setContactBirthday (final Date contactBirthday) { + this.contactBirthday = contactBirthday; } @Override - public DialableCellphoneNumber getCellphoneNumber () { - return this.cellphoneNumber; + public DialableCellphoneNumber getContactCellphoneNumber () { + return this.contactCellphoneNumber; } @Override - public void setCellphoneNumber (final DialableCellphoneNumber cellphoneNumber) { - this.cellphoneNumber = cellphoneNumber; + public void setContactCellphoneNumber (final DialableCellphoneNumber contactCellphoneNumber) { + this.contactCellphoneNumber = contactCellphoneNumber; } @Override - public String getCity () { - return this.city; + public String getContactCity () { + return this.contactCity; } @Override - public void setCity (final String city) { - this.city = city; + public void setContactCity (final String contactCity) { + this.contactCity = contactCity; } @Override - public String getComment () { - return this.comment; + public String getContactComment () { + return this.contactComment; } @Override - public void setComment (final String comment) { - this.comment = comment; + public void setContactComment (final String contactComment) { + this.contactComment = contactComment; } @Override @@ -342,154 +341,154 @@ public class UserContact implements Contact, Comparable { } @Override - public Country getCountry () { - return this.country; + public Country getContactCountry () { + return this.contactCountry; } @Override - public void setCountry (final Country country) { - this.country = country; + public void setContactCountry (final Country contactCountry) { + this.contactCountry = contactCountry; } @Override - public Calendar getCreated () { - return this.created; + public Calendar getContactCreated () { + return this.contactCreated; } @Override - public void setCreated (final Calendar created) { - this.created = created; + public void setContactCreated (final Calendar contactCreated) { + this.contactCreated = contactCreated; } @Override - public String getEmailAddress () { - return this.emailAddress; + public String getContactEmailAddress () { + return this.contactEmailAddress; } @Override - public void setEmailAddress (final String emailAddress) { - this.emailAddress = emailAddress; + public void setContactEmailAddress (final String contactEmailAddress) { + this.contactEmailAddress = contactEmailAddress; } @Override - public String getFamilyName () { + public String getContactFamilyName () { //* NOISY-DEBUG: */ this.getLogger().logTrace("CALLED!"); - return this.familyName; + return this.contactFamilyName; } @Override - public void setFamilyName (final String familyName) { - this.familyName = familyName; + public void setContactFamilyName (final String contactFamilyName) { + this.contactFamilyName = contactFamilyName; } @Override - public DialableFaxNumber getFaxNumber () { - return this.faxNumber; + public DialableFaxNumber getContactFaxNumber () { + return this.contactFaxNumber; } @Override - public void setFaxNumber (final DialableFaxNumber faxNumber) { - this.faxNumber = faxNumber; + public void setContactFaxNumber (final DialableFaxNumber contactFaxNumber) { + this.contactFaxNumber = contactFaxNumber; } @Override - public String getFirstName () { - return this.firstName; + public String getContactFirstName () { + return this.contactFirstName; } @Override - public void setFirstName (final String firstName) { - this.firstName = firstName; + public void setContactFirstName (final String contactFirstName) { + this.contactFirstName = contactFirstName; } @Override - public Gender getGender () { - return this.gender; + public Gender getContactGender () { + return this.contactGender; } @Override - public void setGender (final Gender gender) { - this.gender = gender; + public void setContactGender (final Gender contactGender) { + this.contactGender = contactGender; } @Override - public Short getHouseNumber () { - return this.houseNumber; + public Short getContactHouseNumber () { + return this.contactHouseNumber; } @Override - public void setHouseNumber (final Short houseNumber) { - this.houseNumber = houseNumber; + public void setContactHouseNumber (final Short contactHouseNumber) { + this.contactHouseNumber = contactHouseNumber; } @Override - public void setOwnContact (final Boolean ownContact) { - this.ownContact = ownContact; + public void setContactOwnContact (final Boolean contactOwnContact) { + this.contactOwnContact = contactOwnContact; } @Override - public DialableLandLineNumber getPhoneNumber () { - return this.phoneNumber; + public DialableLandLineNumber getContactPhoneNumber () { + return this.contactPhoneNumber; } @Override - public void setPhoneNumber (final DialableLandLineNumber phoneNumber) { - this.phoneNumber = phoneNumber; + public void setContactPhoneNumber (final DialableLandLineNumber contactPhoneNumber) { + this.contactPhoneNumber = contactPhoneNumber; } @Override - public String getStreet () { - return this.street; + public String getContactStreet () { + return this.contactStreet; } @Override - public void setStreet (final String street) { - this.street = street; + public void setContactStreet (final String contactStreet) { + this.contactStreet = contactStreet; } @Override - public Calendar getUpdated () { - return this.updated; + public Calendar getContactUpdated () { + return this.contactUpdated; } @Override - public void setUpdated (final Calendar updated) { - this.updated = updated; + public void setContactUpdated (final Calendar contactUpdated) { + this.contactUpdated = contactUpdated; } @Override - public Integer getZipCode () { - return this.zipCode; + public Integer getContactZipCode () { + return this.contactZipCode; } @Override - public void setZipCode (final Integer zipCode) { - this.zipCode = zipCode; + public void setContactZipCode (final Integer contactZipCode) { + this.contactZipCode = contactZipCode; } @Override public int hashCode () { - // Validate gender instance - assert (this.getGender() instanceof Gender) : "gender is not set."; //NOI18N + // Validate contactGender instance + assert (this.getContactGender() instanceof Gender) : "gender is not set."; //NOI18N int hash = 7; - hash = 79 * hash + Objects.hashCode(this.getFamilyName()); - hash = 79 * hash + this.getGender().hashCode(); - hash = 79 * hash + Objects.hashCode(this.getFirstName()); + hash = 79 * hash + Objects.hashCode(this.getContactFamilyName()); + hash = 79 * hash + this.getContactGender().hashCode(); + hash = 79 * hash + Objects.hashCode(this.getContactFirstName()); return hash; } /** - * Initialization with fake gender UNKNOWN + * Initialization with fake contactGender UNKNOWN */ @PostConstruct public void init () { - // Fake gender - this.gender = Gender.UNKNOWN; + // Fake contactGender + this.contactGender = Gender.UNKNOWN; } @Override public Boolean isOwnContact () { - return this.ownContact; + return this.contactOwnContact; } } diff --git a/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java b/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java index a4910ff..5535c21 100644 --- a/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java +++ b/src/org/mxchange/jcontacts/contact/gender/GenderUtils.java @@ -44,13 +44,13 @@ public class GenderUtils extends BaseFrameworkSystem { if (null == contact) { // Abort here throw new NullPointerException("contact is null"); - } else if (contact.getGender() == null) { + } else if (contact.getContactGender() == null) { // Gender is not set throw new NullPointerException(MessageFormat.format("contact {0} has no gender set.", contact)); } // Get key from it - String key = contact.getGender().getMessageKey(); + String key = contact.getContactGender().getMessageKey(); // Translate and return it return utils.getMessageStringFromKey(key); diff --git a/src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java b/src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java index 1b8e63d..8b1f558 100644 --- a/src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java +++ b/src/org/mxchange/jcontacts/exceptions/ContactAlreadyAddedException.java @@ -37,7 +37,7 @@ public class ContactAlreadyAddedException extends Exception { * @param contact Contact that is already added */ public ContactAlreadyAddedException (final Contact contact) { - super(MessageFormat.format("Contact with gender={0}, firstName={1} and familyName={2} already added.", contact.getGender(), contact.getFirstName(), contact.getFamilyName())); + super(MessageFormat.format("Contact with gender={0}, firstName={1} and familyName={2} already added.", contact.getContactGender(), contact.getContactFirstName(), contact.getContactFamilyName())); } /** -- 2.39.5