T - the types of object this Equator can evaluate.public class DefaultEquator<T> extends Object implements Equator<T>, Serializable
Equator implementation.| Modifier and Type | Field and Description |
|---|---|
static int |
HASHCODE_NULL
Hashcode used for
null objects. |
static DefaultEquator |
INSTANCE
Static instance
|
| Modifier and Type | Method and Description |
|---|---|
static <T> DefaultEquator<T> |
defaultEquator()
Factory returning the typed singleton instance.
|
boolean |
equate(T o1,
T o2)
Evaluates the two arguments for their equality.
|
int |
hash(T o)
Calculates the hash for the object, based on the method of equality used in the equate
method.
|
public static final DefaultEquator INSTANCE
public static final int HASHCODE_NULL
null objects.public static <T> DefaultEquator<T> defaultEquator()
T - the object typepublic boolean equate(T o1, T o2)
Object.equals(Object).public int hash(T o)
equals(Object) method to an
Equator (and so must also delegate their hashCode() method), or for implementations
of HashedMap that use an Equator for the key objects.hash in interface Equator<T>o - the object to calculate the hash for.o.hashCode() if o is non-
null, else HASHCODE_NULL.Copyright © 2001–2013 The Apache Software Foundation. All rights reserved.