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 c67a11f008
commit 51e148e2ec

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); } 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 @Override
public int hashCode() { return Objects.hash(id); } 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 @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {