public class ComparatorUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Comparator<?> |
NULL_HIGH_COMPARABLE
a comparator that compares
Comparable objects using
nullHighCompareTo(Comparable, Object) |
static Comparator<?> |
NULL_LOW_COMPARABLE
a comparator that compares
Comparable objects using
nullLowCompareTo(Comparable, Object) |
| Constructor and Description |
|---|
ComparatorUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Comparator<T> |
nullHighComparable() |
static <T> int |
nullHighCompareTo(Comparable<T> o1,
T o2)
null-safe invocation of
Comparable.compareTo(Object) placing
null at the end of a sorted list (assuming each
null is equal) |
static <T> Comparator<T> |
nullLowComparable() |
static <T> int |
nullLowCompareTo(Comparable<T> o1,
T o2)
null-safe invocation of
Comparable.compareTo(Object) placing
null at the beginning of a sorted list (assuming each
null is equal) |
public static final Comparator<?> NULL_LOW_COMPARABLE
Comparable objects using
nullLowCompareTo(Comparable, Object)public static final Comparator<?> NULL_HIGH_COMPARABLE
Comparable objects using
nullHighCompareTo(Comparable, Object)public static final <T> Comparator<T> nullLowComparable()
NULL_LOW_COMPARABLEpublic static final <T> Comparator<T> nullHighComparable()
NULL_HIGH_COMPARABLEpublic static <T> int nullLowCompareTo(Comparable<T> o1, T o2)
Comparable.compareTo(Object) placing
null at the beginning of a sorted list (assuming each
null is equal)Comparable.compareTo(Object)public static <T> int nullHighCompareTo(Comparable<T> o1, T o2)
Comparable.compareTo(Object) placing
null at the end of a sorted list (assuming each
null is equal)Comparable.compareTo(Object)Copyright © 2014 Molindo GmbH. All Rights Reserved.