|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.identityconnectors.common.EqualsHashCodeBuilder
public final class EqualsHashCodeBuilder
Builder to simplify implementing the Object.equals(Object)
and Object.hashCode()
methods. This class uses ArrayList
's implementation of AbstractList.equals(Object)
and AbstractList.hashCode()
and takes special care with deep arrays and Collection
based objects.
Constructor Summary | |
---|---|
EqualsHashCodeBuilder() Construct the builder. |
Method Summary | |
---|---|
EqualsHashCodeBuilder |
append(java.lang.Object object) Appends the field value to an ArrayList to help facilitate equality testing. |
void |
appendBean(java.lang.Object obj) This method will attempt to use reflection to get all the properties that make up the identity of the object. |
boolean |
equals(java.lang.Object obj) Determine equality based on the value of the members append to the builder. |
int |
hashCode() Determine the hashcode based on the various members. |
java.lang.String |
toString() Show the contents that make up the key. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EqualsHashCodeBuilder()
Method Detail |
---|
public EqualsHashCodeBuilder append(java.lang.Object object)
java.lang.IllegalArgumentException
- iff a collection is passed since collections do not support value based equality. Sets, Lists, and Maps will work since they support value based equality.public void appendBean(java.lang.Object obj)
append(Object)
all results from get methods that have a corresponding set method.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |