T - The type for the comparator.public abstract class CoercingComparator<T>
extends java.lang.Object
| Constructor and Description |
|---|
CoercingComparator() |
| Modifier and Type | Method and Description |
|---|---|
static <TA,TB> int |
coerceAndCompare(TA o1,
TB o2)
Finds the comparator for
a and b and delegates the coercion/comparison to the comparator
according to priority. |
static <TA,TB> boolean |
coerceAndEquals(TA o1,
TB o2)
Finds the comparator for
a and b and delegates the coercion/equal to the comparator
according to priority. |
static <V> CoercingComparator<V> |
getComparator(V value,
java.lang.Object v2)
Obtains the coercing comparator for the given
value. |
protected java.lang.IllegalArgumentException |
uncoercable(java.lang.Object v) |
public static <TA,TB> int coerceAndCompare(TA o1,
TB o2)
throws java.lang.IllegalArgumentException
a and b and delegates the coercion/comparison to the comparator
according to priority.o1 - the first object to be compared.o2 - the second object to be compared.java.lang.IllegalArgumentException - if no comparator was found or if coercion was impossibleComparator.compare(Object, Object)public static <TA,TB> boolean coerceAndEquals(TA o1,
TB o2)
throws java.lang.IllegalArgumentException
a and b and delegates the coercion/equal to the comparator
according to priority.o1 - the first object to be compared.o2 - the second object to be compared.java.lang.IllegalArgumentException - if no comparator was found or if coercion was impossibleObject.equals(Object)public static <V> CoercingComparator<V> getComparator(V value, java.lang.Object v2)
value.value - The valueprotected java.lang.IllegalArgumentException uncoercable(java.lang.Object v)