public class IdentifiableHashEquals extends Object implements HashEquals
A HashEquals implementation for of Identifiable classes to
use the value returned from Identifiable.getIdentifier() to calculate
the hash code and test for equality.
| Constructor and Description |
|---|
IdentifiableHashEquals() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object value1,
Object value2)
Test the
Identifiable.getIdentifier() values of two Identifiable
objects to see if the identifiers are equal. |
static Identifier |
getIdentifier(Object value)
Get the
Identifiable.getIdentifier() values of a Identifiable object. |
int |
hashCode(Object value)
Calculate the hash code for an
Identifiable object. |
public static Identifier getIdentifier(Object value)
Identifiable.getIdentifier() values of a Identifiable object.value - The value.public boolean equals(Object value1, Object value2)
Test the Identifiable.getIdentifier() values of two Identifiable
objects to see if the identifiers are equal. If the records are ==, then true is returned.
If either of the objects are not Identifiable
or have a null identifier then false is returned. Otherwise true is returned if the identifiers
are equal.
equals in interface HashEqualsvalue1 - The first value.value2 - The second value.public int hashCode(Object value)
Calculate the hash code for an Identifiable object. 0 is returned if the
Identifiable.getIdentifier() is null or the object is not Identifiable.
hashCode in interface HashEqualsvalue - The value to calculate the hash code for.Copyright © 2015 Revolution Systems Inc.. All rights reserved.