类 Comparators
- java.lang.Object
- org.springframework.util.comparator.Comparators
public abstract class Comparators extends Object
Convenient entry point with generically typed factory methods for common SpringComparatorvariants.- 从以下版本开始:
- 5.0
- 作者:
- Juergen Hoeller
构造器概要
构造器 构造器 说明 Comparators()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static <T> Comparator<T>comparable()Return aComparableadapter.static <T> Comparator<T>nullsHigh()Return aComparableadapter 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 aComparableadapter 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.
构造器详细资料
Comparators
public Comparators()
方法详细资料
comparable
public static <T> Comparator<T> comparable()
Return aComparableadapter.
nullsLow
public static <T> Comparator<T> nullsLow()
Return aComparableadapter which accepts null values and sorts them lower than non-null values.
nullsLow
public 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.
nullsHigh
public static <T> Comparator<T> nullsHigh()
Return aComparableadapter which accepts null values and sorts them higher than non-null values.
nullsHigh
public 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.