-
- All Known Implementing Classes:
ObjectComparator.DefaultComparator
,ObjectComparator.IdentityComparator
public interface ObjectComparator<T>
Interface for equality comparison.The equals and hashCode methods of this interace are used instead of the methods of the compared Objects.
The DefaultComparator implmentation calls the Object's methods.
The IdentityComparator implementation uses
==
instead of the equals method of the Object.Updated for generics fredt@users.
- Since:
- 2.0
- Author:
- fredt@users
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ObjectComparator.DefaultComparator<T>
Comparator that uses the equals and hash code methods of Objects.static class
ObjectComparator.IdentityComparator<T>
Comparator that uses identity for Object equality.
-
Field Summary
Fields Modifier and Type Field Description static ObjectComparator
defaultComparator
static ObjectComparator
identityComparator
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
equals(T a, T b)
int
hashCode(T a)
long
longKey(T a)
-
-
-
Field Detail
-
defaultComparator
static final ObjectComparator defaultComparator
-
identityComparator
static final ObjectComparator identityComparator
-
-