Class NullComparator<T>
java.lang.Object
org.magicwerk.brownies.collections.helper.SingletonComparator<T>
org.magicwerk.brownies.collections.helper.NullComparator<T>
- Type Parameters:
T
- element type
- All Implemented Interfaces:
Serializable
,Comparator<T>
A NullComparator extends an existing comparator so it can handle null values.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.magicwerk.brownies.collections.helper.SingletonComparator
equals, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
comparator
-
nullsFirst
private boolean nullsFirst
-
-
Constructor Details
-
NullComparator
Constructor.- Parameters:
comparator
- comparator to extendnullsFirst
- true to sort nulls first, false to sort null last
-
-
Method Details
-
compare
-