|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.objectvalidation.rules.HashCodeComplientRule
public class HashCodeComplientRule
Assert the compliancy of an object hashCode() method. Rules are the following : - Same objects must produce the same hashCode number. - Equals object have the same number - Unequal numbers produce different hashcode number
| Constructor Summary | |
|---|---|
HashCodeComplientRule(ObjectCreator randomFactory,
ObjectCloner objectCloner)
|
|
| Method Summary | |
|---|---|
void |
checkConsistency(Object object)
Checks that the hashCode is consistent with the same object. |
void |
checkTwoEqualsObjectsProduceSameNumber(Object firstObject,
Object equalsObject)
Objects that are equal using the equals method should return the same integer. |
void |
validate(Class<?> bean)
Will run the validations on the java class passed in parameter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HashCodeComplientRule(ObjectCreator randomFactory,
ObjectCloner objectCloner)
| Method Detail |
|---|
public void validate(Class<?> bean)
Rule
validate in interface Rulepublic void checkConsistency(Object object)
public void checkTwoEqualsObjectsProduceSameNumber(Object firstObject,
Object equalsObject)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||