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