A Comparator API
runeflobakk opened this issue · 1 comments
runeflobakk commented
It's already possible to create Comparators using a Fn<?, ? extends Comparable<?>>
. It should return an interface (say EnhancedComparator<T>
or similar) with methods to create modifications based on the original Comparator.
Suggestion:
interface EnhancedComparator<T> extends Comparator<T> {
EnhancedComparator<T> descending();
EnhancedComparator<T> nullsFirst(); //nullsafe comparator
EnhancedComparator<T> nullsLast(); //nullsafe comparator
}
runeflobakk commented
Pushed to dev branch e2e547e