-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CheckedComparator<T>AComparatorthat allows for checked exceptions.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description intcompare(T o1, T o2)Compares its two arguments for order.static <T> java.util.Comparator<T>sneaky(CheckedComparator<T> comparator)static <T> java.util.Comparator<T>unchecked(CheckedComparator<T> comparator)static <T> java.util.Comparator<T>unchecked(CheckedComparator<T> comparator, java.util.function.Consumer<java.lang.Throwable> handler)
-
-
-
Method Detail
-
compare
int compare(T o1, T o2) throws java.lang.Throwable
Compares its two arguments for order.- Throws:
java.lang.Throwable
-
sneaky
static <T> java.util.Comparator<T> sneaky(CheckedComparator<T> comparator)
-
unchecked
static <T> java.util.Comparator<T> unchecked(CheckedComparator<T> comparator)
-
unchecked
static <T> java.util.Comparator<T> unchecked(CheckedComparator<T> comparator, java.util.function.Consumer<java.lang.Throwable> handler)
-
-