Interface Throwing.BinaryOperator<T,X extends Throwable>
- Type Parameters:
T
- the type of the operands and result of the operatorX
- a sort of throwable that theThrowing.BinaryOperator
may throw
- All Superinterfaces:
Throwing.BiFunction<T,T,T,X>
- Enclosing class:
- Throwing
- 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 static interface Throwing.BinaryOperator<T,X extends Throwable>
extends Throwing.BiFunction<T,T,T,X>
Equivalent of
BinaryOperator
that may throw
non-RuntimeException
throwables.-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T, X extends Throwable>
Throwing.BinaryOperator<T,X>maxBy(Throwing.Comparator<? super T,? extends X> comparator)
Returns aThrowing.BinaryOperator
which returns the greater of two elements according to the specifiedComparator
.static <T, X extends Throwable>
Throwing.BinaryOperator<T,X>minBy(Throwing.Comparator<? super T,? extends X> comparator)
Returns aThrowing.BinaryOperator
which returns the lesser of two elements according to the specifiedComparator
.Methods inherited from interface io.github.oliviercailloux.jaris.exceptions.Throwing.BiFunction
andThen, apply
-
Method Details
-
minBy
static <T, X extends Throwable> Throwing.BinaryOperator<T,X> minBy(Throwing.Comparator<? super T,? extends X> comparator)Returns aThrowing.BinaryOperator
which returns the lesser of two elements according to the specifiedComparator
.- Type Parameters:
T
- the type of the input arguments of the comparatorX
- the sort of throwable that the returned instance may throw- Parameters:
comparator
- aThrowing.Comparator
for comparing the two values- Returns:
- a
Throwing.BinaryOperator
which returns the lesser of its operands, according to the suppliedThrowing.Comparator
-
maxBy
static <T, X extends Throwable> Throwing.BinaryOperator<T,X> maxBy(Throwing.Comparator<? super T,? extends X> comparator)Returns aThrowing.BinaryOperator
which returns the greater of two elements according to the specifiedComparator
.- Type Parameters:
T
- the type of the input arguments of the comparatorX
- the sort of throwable that the returned instance may throw- Parameters:
comparator
- aThrowing.Comparator
for comparing the two values- Returns:
- a
Throwing.BinaryOperator
which returns the greater of its operands, according to the suppliedThrowing.Comparator
-