About
The equals method is used in implementation such as set implementation in order to be sure that there will be no duplicate objects.
If two objects are equal, they must have the same hashCode()
.
Articles Related
Utility
org.apache.commons.lang.builder
package org.apache.commons.lang.builder;
EqualsBuilder comparator = new EqualsBuilder();
// Note that this compares case sensitive
comparator.append(name, other.name);
comparator.append(..., other....);
return comparator.isEquals();