public abstract class StatelessEquivalence<T> extends Equivalence<T>
Equivalence
implementations.
StatelessEquivalence
relies on the fact that your equivalence class,
which extend it, don't have subclasses in turn, therefore it is strongly recommended to declare
your equivalence class as final
.
Override toString()
if implementation is anonymous and you want to log
or pretty print it, because otherwise String
representation of your equivalence
would be ""
(empty String
).
See example implementations in the documentation to identity and case insensitive equivalences.
Modifier | Constructor and Description |
---|---|
protected |
StatelessEquivalence()
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Returns
true if the given object is also an instance of this equivalence class. |
int |
hashCode()
Returns a hash code of this equivalence class.
|
String |
toString()
Returns simple name of this equivalence class,
getClass().getSimpleName() . |
caseInsensitive, charSequence, defaultEquality, entryEquivalence, equivalent, hash, identity, nullableEquivalent, nullableHash
protected StatelessEquivalence()
public boolean equals(Object o)
true
if the given object is also an instance of this equivalence class.equals
in class Equivalence<T>
public int hashCode()
hashCode
in class Equivalence<T>