-
public final class SortComparator<T extends Object, V extends Comparable<V>>A comparator that can sort model instances by extracting comparable values.
This class provides the foundation for local sorting operations by wrapping a lambda that extracts comparable values from model instances. It handles the comparison logic and direction handling internally.
-
-
Constructor Summary
Constructors Constructor Description SortComparator(Function1<T, V> value)
-
Method Summary
-
-
Method Detail
-
compare
final Integer compare(T lhs, T rhs, SortDirection direction)
Compares two model instances using the extracted values and sort direction.
- Parameters:
lhs- The first model instance to comparerhs- The second model instance to comparedirection- The direction of the sort
-
toAny
final AnySortComparator<T> toAny()
Converts this comparator to a type-erased version.
-
-
-
-