com.puppycrawl.tools.checkstyle.checks.coding
public class EqualsHashCodeCheck extends Check
Checks that classes that override equals() also override hashCode().
Rationale: The contract of equals() and hashCode() requires that equal objects have the same hashCode. Hence, whenever you override equals() you must override hashCode() to ensure that your class can be used in collections that are hash based.
An example of how to configure the check is:
<module name="EqualsHashCode"/>
Method Summary | |
---|---|
void | beginTree(DetailAST aRootAST) {@inheritDoc} |
void | finishTree(DetailAST aRootAST)
{@inheritDoc} |
int[] | getDefaultTokens() {@inheritDoc} |
void | visitToken(DetailAST aAST) {@inheritDoc} |