From: Roland Haeder Date: Thu, 22 Oct 2015 07:56:22 +0000 (+0200) Subject: added title (e.g. "Dr.") X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a01178b85f27ec44dc2cb7d07bbdee4f4875be2b;p=jcontacts-core.git added title (e.g. "Dr.") Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/jcontacts/contact/Contact.java b/src/org/mxchange/jcontacts/contact/Contact.java index 0411207..6b6561d 100644 --- a/src/org/mxchange/jcontacts/contact/Contact.java +++ b/src/org/mxchange/jcontacts/contact/Contact.java @@ -256,6 +256,20 @@ public interface Contact extends Serializable { */ void setContactStreet (final String street); + /** + * Getter for contact's title + *

+ * @return Contact's title + */ + String getContactTitle (); + + /** + * Setter for contact's title + *

+ * @param contactTitle Contact's title + */ + void setContactTitle (final String contactTitle); + /** * Getter for "updated" timestamp *

@@ -299,8 +313,8 @@ public interface Contact extends Serializable { * @return Whether both contacts are same TODO Needs a lot improvements */ @Override - boolean equals (final Object object); + boolean equals (final Object object); @Override - int hashCode (); + int hashCode (); } diff --git a/src/org/mxchange/jcontacts/contact/UserContact.java b/src/org/mxchange/jcontacts/contact/UserContact.java index 012db4f..c9fa3ec 100644 --- a/src/org/mxchange/jcontacts/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/contact/UserContact.java @@ -185,6 +185,12 @@ public class UserContact implements Contact, Comparable { @Column (name = "contact_street", nullable = false) private String contactStreet; + /** + * Title (Doctor, etc) + */ + @Column (name = "contact_title") + private String contactTitle; + /** * When the contact has been updated */ @@ -283,9 +289,9 @@ public class UserContact implements Contact, Comparable { Contact contact = (Contact) object; // Now test some data TODO Definedly needs improvement - return ((this.getContactGender().equals(contact.getContactGender())) && - (this.getContactFirstName().toLowerCase().equals(contact.getContactFirstName().toLowerCase())) && - (this.getContactFamilyName().toLowerCase().equals(contact.getContactFamilyName().toLowerCase()))); + return ((this.getContactGender().equals(contact.getContactGender())) + && (this.getContactFirstName().toLowerCase().equals(contact.getContactFirstName().toLowerCase())) + && (this.getContactFamilyName().toLowerCase().equals(contact.getContactFamilyName().toLowerCase()))); } @Override @@ -444,6 +450,16 @@ public class UserContact implements Contact, Comparable { this.contactStreet = contactStreet; } + @Override + public String getContactTitle () { + return this.contactTitle; + } + + @Override + public void setContactTitle (final String contactTitle) { + this.contactTitle = contactTitle; + } + @Override public Calendar getContactUpdated () { return this.contactUpdated;