Class Comparators
java.lang.Object
org.springframework.util.comparator.Comparators
Convenient entry point with generically typed factory methods
for common Spring
Comparator
variants.- Since:
- 5.0
- Author:
- Juergen Hoeller
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Comparator<T>
Return aComparable
adapter.static <T> Comparator<T>
Return aComparable
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 aComparable
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.
-
Constructor Details
-
Comparators
public Comparators()
-
-
Method Details
-
comparable
Return aComparable
adapter.- See Also:
-
nullsLow
Return aComparable
adapter which accepts null values and sorts them lower than non-null values.- See Also:
-
nullsLow
Return a decorator for the given comparator which accepts null values and sorts them lower than non-null values.- See Also:
-
nullsHigh
Return aComparable
adapter which accepts null values and sorts them higher than non-null values.- See Also:
-
nullsHigh
Return a decorator for the given comparator which accepts null values and sorts them higher than non-null values.- See Also:
-