Add Javadoc for hashCode and equals methods of Contact

This commit is contained in:
Kai S. K. Engelbart 2020-06-11 11:05:38 +02:00
parent c5c6f5a335
commit 2ecb292588

View File

@ -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) {