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 SingletonComparator
equals, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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
-