Add Javadoc for hashCode and equals methods of Contact
This commit is contained in:
parent
c5c6f5a335
commit
2ecb292588
@ -62,13 +62,19 @@ public abstract class Contact implements Serializable {
|
||||
public String toString() { return String.format("Contact[id=%d,name=%s, contacts=%s]", id, name, contacts); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Provides a hash code based on the ID of this contact.
|
||||
*
|
||||
* @since Envoy Common v0.1-beta
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() { return Objects.hash(id); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Tests equality to another object. If that object is a contact as well,
|
||||
* equality is determined by the ID.
|
||||
*
|
||||
* @param obj the object to test for equality to this contact
|
||||
* @return {code true} if both objects are contacts and have identical IDs
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
Reference in New Issue
Block a user