Class DefaultEquator<T>
- java.lang.Object
 - 
- org.apache.commons.collections4.functors.DefaultEquator<T>
 
 
- 
- Type Parameters:
 T- the types of object thisEquatorcan evaluate.
- All Implemented Interfaces:
 java.io.Serializable,Equator<T>
public class DefaultEquator<T> extends java.lang.Object implements Equator<T>, java.io.Serializable
DefaultEquatorimplementation.- Since:
 - 4.0
 - See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static intHASHCODE_NULLHashcode used fornullobjects.static DefaultEquatorINSTANCEStatic instance 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> DefaultEquator<T>defaultEquator()Factory returning the typed singleton instance.booleanequate(T o1, T o2)Evaluates the two arguments for their equality.inthash(T o)Calculates the hash for the object, based on the method of equality used in the equate method. 
 - 
 
- 
- 
Field Detail
- 
INSTANCE
public static final DefaultEquator INSTANCE
Static instance 
- 
HASHCODE_NULL
public static final int HASHCODE_NULL
Hashcode used fornullobjects.- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
defaultEquator
public static <T> DefaultEquator<T> defaultEquator()
Factory returning the typed singleton instance.- Type Parameters:
 T- the object type- Returns:
 - the singleton instance
 
 
- 
equate
public boolean equate(T o1, T o2)
Evaluates the two arguments for their equality. Delegates toObject.equals(Object). 
- 
hash
public int hash(T o)
Calculates the hash for the object, based on the method of equality used in the equate method. This is used for classes that delegate theirequals(Object)method to an Equator (and so must also delegate theirhashCode()method), or for implementations ofHashedMapthat use an Equator for the key objects.- Specified by:
 hashin interfaceEquator<T>- Parameters:
 o- the object to calculate the hash for.- Returns:
 o.hashCode()ifois non-null, elseHASHCODE_NULL.
 
 - 
 
 -