* <p>
* @param object Other possible contact class
* <p>
- * @return Whether both contacts are same TODO Needs a lot improvements
+ * @return Whether both contacts are same
*/
@Override
boolean equals (final Object object);
@Index (
name = "contact_gender",
columnList = "contact_gender"
- ),
- @Index (
- name = "contact_email_address",
- unique = true,
- columnList = "contact_email_address"
)
}
)
/**
* Email address
*/
- @Column (name = "contact_email_address", length = 100)
+ @Column (name = "contact_email_address", length = 100, unique = true)
private String contactEmailAddress;
/**
@Override
public boolean equals (final Object object) {
// Is it same type?
- if (!(object instanceof UserContact)) {
+ if (null == object) {
+ // Is null
+ return false;
+ } else if (!(object instanceof UserContact)) {
// Not equal types
return false;
} else if (!(object instanceof Contact)) {
public Boolean isOwnContact () {
return this.contactOwnContact;
}
+
}