|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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(Object object)
Appends the field value to an ArrayList to help facilitate equality testing. |
void |
appendBean(Object obj)
This method will attempt to use reflection to get all the properties that make up the identity of the object. |
boolean |
equals(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. |
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(Object object)
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(Object obj)
append(Object)
all
results from get methods that have a corresponding
set method.
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |