public abstract class Comparators extends Object
Comparator
variants.Constructor and Description |
---|
Comparators() |
Modifier and Type | Method and Description |
---|---|
static <T> Comparator<T> |
comparable()
Return a
Comparable adapter. |
static <T> Comparator<T> |
nullsHigh()
Return a
Comparable adapter which accepts
null values and sorts them higher than non-null values. |
static <T> Comparator<T> |
nullsHigh(Comparator<T> comparator)
Return a decorator for the given comparator which accepts
null values and sorts them higher than non-null values.
|
static <T> Comparator<T> |
nullsLow()
Return a
Comparable adapter which accepts
null values and sorts them lower than non-null values. |
static <T> Comparator<T> |
nullsLow(Comparator<T> comparator)
Return a decorator for the given comparator which accepts
null values and sorts them lower than non-null values.
|
public static <T> Comparator<T> comparable()
Comparable
adapter.ComparableComparator.INSTANCE
public static <T> Comparator<T> nullsLow()
Comparable
adapter which accepts
null values and sorts them lower than non-null values.NullSafeComparator.NULLS_LOW
public static <T> Comparator<T> nullsLow(Comparator<T> comparator)
NullSafeComparator(boolean)
public static <T> Comparator<T> nullsHigh()
Comparable
adapter which accepts
null values and sorts them higher than non-null values.NullSafeComparator.NULLS_HIGH
public static <T> Comparator<T> nullsHigh(Comparator<T> comparator)
NullSafeComparator(boolean)