T
- the type of objects that may be compared by this comparator@FunctionalInterface public interface ComparatorEx<T> extends Comparator<T>, Serializable
Serializable
variant of java.util.Comparator
which declares checked exception.equals
int compareEx(T o1, T o2) throws Exception
Comparator.compare(T, T)
.Exception
- in case of any exceptional casedefault int compare(T o1, T o2)
compare
in interface Comparator<T>
static <T extends Comparable<? super T>> ComparatorEx<T> naturalOrder()
Serializable
variant of java.util.Comparator#naturalOrder()
.naturalOrder
in interface Comparator<T>
T
- the Comparable
type of element to be comparedstatic <T extends Comparable<? super T>> ComparatorEx<T> reverseOrder()
Serializable
variant of java.util.Comparator#reverseOrder()
.reverseOrder
in interface Comparator<T>
T
- the Comparable
type of element to be comparedstatic <T> ComparatorEx<T> nullsFirst(Comparator<? super T> comparator)
Serializable
variant of java.util.Comparator#nullsFirst(Comparator)
.nullsFirst
in interface Comparator<T>
T
- the type of the elements to be comparedstatic <T> ComparatorEx<T> nullsFirst(ComparatorEx<? super T> comparator)
Serializable
variant of java.util.Comparator#nullsFirst(Comparator)
.T
- the type of the elements to be comparedstatic <T> ComparatorEx<T> nullsLast(Comparator<? super T> comparator)
Serializable
variant of java.util.Comparator#nullsLast(Comparator)
.nullsLast
in interface Comparator<T>
T
- the type of the elements to be comparedstatic <T> ComparatorEx<T> nullsLast(ComparatorEx<? super T> comparator)
Serializable
variant of java.util.Comparator#nullsLast(Comparator)
.T
- the type of the elements to be comparedstatic <T,U> ComparatorEx<T> comparing(Function<? super T,? extends U> toKeyFn, Comparator<? super U> keyComparator)
Serializable
variant of java.util.Comparator#comparing(Function, Comparator)
.comparing
in interface Comparator<T>
T
- the type of element to be comparedU
- the type of the sort keystatic <T,U> ComparatorEx<T> comparing(FunctionEx<? super T,? extends U> toKeyFn, ComparatorEx<? super U> keyComparator)
Serializable
variant of java.util.Comparator#comparing(Function, Comparator)
.T
- the type of element to be comparedU
- the type of the sort keystatic <T,U extends Comparable<? super U>> ComparatorEx<T> comparing(Function<? super T,? extends U> toKeyFn)
Serializable
variant of java.util.Comparator#comparing(Function)
.comparing
in interface Comparator<T>
T
- the type of element to be comparedU
- the type of the Comparable
sort keystatic <T,U extends Comparable<? super U>> ComparatorEx<T> comparing(FunctionEx<? super T,? extends U> toKeyFn)
Serializable
variant of java.util.Comparator#comparing(Function)
.T
- the type of element to be comparedU
- the type of the Comparable
sort keystatic <T> ComparatorEx<T> comparingInt(ToIntFunction<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#comparingInt(ToIntFunction)
.comparingInt
in interface Comparator<T>
T
- the type of element to be comparedstatic <T> ComparatorEx<T> comparingInt(ToIntFunctionEx<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#comparingInt(ToIntFunction)
.T
- the type of element to be comparedstatic <T> ComparatorEx<T> comparingLong(ToLongFunction<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#comparingLong(ToLongFunction)
.comparingLong
in interface Comparator<T>
T
- the type of element to be comparedstatic <T> ComparatorEx<T> comparingLong(ToLongFunctionEx<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#comparingLong(ToLongFunction)
.T
- the type of element to be comparedstatic <T> ComparatorEx<T> comparingDouble(ToDoubleFunction<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#comparingDouble(ToDoubleFunction)
.comparingDouble
in interface Comparator<T>
T
- the type of element to be comparedstatic <T> ComparatorEx<T> comparingDouble(ToDoubleFunctionEx<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#comparingDouble(ToDoubleFunction)
.T
- the type of element to be compareddefault ComparatorEx<T> thenComparing(Comparator<? super T> other)
Serializable
variant of java.util.Comparator#thenComparing(Comparator)
.thenComparing
in interface Comparator<T>
default ComparatorEx<T> thenComparing(ComparatorEx<? super T> other)
Serializable
variant of java.util.Comparator#thenComparing(Comparator)
.default <U> ComparatorEx<T> thenComparing(Function<? super T,? extends U> toKeyFn, Comparator<? super U> keyComparator)
Serializable
variant of java.util.Comparator#thenComparing(Function, Comparator)
.thenComparing
in interface Comparator<T>
U
- the type of the sort keydefault <U> ComparatorEx<T> thenComparing(FunctionEx<? super T,? extends U> toKeyFn, ComparatorEx<? super U> keyComparator)
Serializable
variant of java.util.Comparator#thenComparing(Function, Comparator)
.U
- the type of the sort keydefault <U extends Comparable<? super U>> ComparatorEx<T> thenComparing(Function<? super T,? extends U> toKeyFn)
Serializable
variant of java.util.Comparator#thenComparing(Function)
.thenComparing
in interface Comparator<T>
U
- the type of the Comparable
sort keydefault <U extends Comparable<? super U>> ComparatorEx<T> thenComparing(FunctionEx<? super T,? extends U> toKeyFn)
Serializable
variant of java.util.Comparator#thenComparing(Function)
.U
- the type of the Comparable
sort keydefault ComparatorEx<T> thenComparingInt(ToIntFunction<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#thenComparingInt(ToIntFunction)
.thenComparingInt
in interface Comparator<T>
default ComparatorEx<T> thenComparingInt(ToIntFunctionEx<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#thenComparingInt(ToIntFunction)
.default ComparatorEx<T> thenComparingLong(ToLongFunction<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#thenComparingLong(ToLongFunction)
.thenComparingLong
in interface Comparator<T>
default ComparatorEx<T> thenComparingLong(ToLongFunctionEx<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#thenComparingLong(ToLongFunction)
.default ComparatorEx<T> thenComparingDouble(ToDoubleFunction<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#thenComparingDouble(ToDoubleFunction)
.thenComparingDouble
in interface Comparator<T>
default ComparatorEx<T> thenComparingDouble(ToDoubleFunctionEx<? super T> toKeyFn)
Serializable
variant of java.util.Comparator#thenComparingDouble(ToDoubleFunction)
.default ComparatorEx<T> reversed()
Serializable
variant of java.util.Comparator#reversed()
reversed
in interface Comparator<T>
Copyright © 2023 Hazelcast, Inc.. All rights reserved.