T - the type of the operands and result of the operatorE - the type of the potential exception of the functionBiFunctionWithException<T,T,T,E>, ExceptionHandlerSupport<T,E>, ObjectReturnExceptionHandlerSupport<BiFunction<T,U,R>,BiFunction<T,U,Optional<R>>,BiFunction<T,U,CompletionStage<R>>,R>@FunctionalInterface public interface BinaryOperatorWithException<T,E extends Exception> extends BiFunctionWithException<T,T,T,E>
BiFunctionWithException for the case where the
operands and the result are all of the same type.
As this interface must return the same type of the input, a lifted version
which returns Optional is not possible.
T apply(T t, T u) throws
E - The functional method.BinaryOperator<T>BiFunction<T,T,<Optional<T>>BinaryOperator<T>BiFunctionWithException,
BinaryOperator| Modifier and Type | Method | Description |
|---|---|---|
static <T,E extends Exception> |
failing(Supplier<E> exceptionBuilder) |
Returns a binary operator that always throw exception.
|
default BinaryOperator<T> |
ignore() |
Converts this
BinaryOperatorWithException to a lifted
BinaryOperator returning null in case of exception. |
static <T,E extends Exception> |
ignored(BinaryOperatorWithException<T,E> function) |
Converts a
BinaryOperatorWithException to a lifted
BinaryOperator returning null in case of exception. |
static <T,E extends Exception> |
lifted(BinaryOperatorWithException<T,E> function) |
Converts a
BinaryOperatorWithException to a lifted Function
returning an optional in case of exception. |
default BinaryOperator<T> |
uncheck() |
Converts this
BinaryOperatorWithException to a BinaryOperator
that convert exception to RuntimeException. |
static <T,E extends Exception> |
unchecked(BinaryOperatorWithException<T,E> function) |
Converts a
BinaryOperatorWithException to a BinaryOperator
that convert exception to RuntimeException. |
static <T,E extends Exception> |
unchecked(BinaryOperatorWithException<T,E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
BinaryOperatorWithException to a BinaryOperator
that convert exception to RuntimeException by using the provided
mapping function. |
andThen, apply, asBiConsumer, asBiConsumer, asFunction, asFunction, ignored, lift, lifted, stage, staged, unchecked, uncheckedexceptionMapper, exceptionMapperFornotThrowingHandler, staged, throwingHandler, uncheckeddefault BinaryOperator<T> uncheck()
BinaryOperatorWithException to a BinaryOperator
that convert exception to RuntimeException.uncheck in interface BiFunctionWithException<T,T,T,E extends Exception>uncheck in interface ExceptionHandlerSupport<T,E extends Exception>uncheck in interface ObjectReturnExceptionHandlerSupport<BiFunction<T,U,R>,BiFunction<T,U,Optional<R>>,BiFunction<T,U,CompletionStage<R>>,R>unchecked(BinaryOperatorWithException),
unchecked(BinaryOperatorWithException, Function)default BinaryOperator<T> ignore()
BinaryOperatorWithException to a lifted
BinaryOperator returning null in case of exception.ignore in interface BiFunctionWithException<T,T,T,E extends Exception>ignore in interface ExceptionHandlerSupport<T,E extends Exception>ignore in interface ObjectReturnExceptionHandlerSupport<BiFunction<T,U,R>,BiFunction<T,U,Optional<R>>,BiFunction<T,U,CompletionStage<R>>,R>ignored(BinaryOperatorWithException)static <T,E extends Exception> BinaryOperatorWithException<T,E> failing(Supplier<E> exceptionBuilder)
T - the type of the operands and result of the operatorE - the type of the exceptionexceptionBuilder - the supplier to create the exceptionstatic <T,E extends Exception> BinaryOperator<T> unchecked(BinaryOperatorWithException<T,E> function)
BinaryOperatorWithException to a BinaryOperator
that convert exception to RuntimeException.T - the type of the operands and result of the operatorE - the type of the potential exceptionfunction - to be uncheckedNullPointerException - if function is nulluncheck(),
unchecked(BinaryOperatorWithException, Function)static <T,E extends Exception> BinaryOperator<T> unchecked(BinaryOperatorWithException<T,E> function, Function<Exception,RuntimeException> exceptionMapper)
BinaryOperatorWithException to a BinaryOperator
that convert exception to RuntimeException by using the provided
mapping function.T - the type of the operands and result of the operatorE - the type of the potential exceptionfunction - the be uncheckedexceptionMapper - a function to convert the exception to the runtime exception.NullPointerException - if function or exceptionMapper is nulluncheck(),
unchecked(BinaryOperatorWithException)static <T,E extends Exception> BiFunction<T,T,Optional<T>> lifted(BinaryOperatorWithException<T,E> function)
BinaryOperatorWithException to a lifted Function
returning an optional in case of exception.T - the type of the operands and result of the operatorE - the type of the potential exceptionfunction - the be uncheckedNullPointerException - if function is nullignore()static <T,E extends Exception> BinaryOperator<T> ignored(BinaryOperatorWithException<T,E> function)
BinaryOperatorWithException to a lifted
BinaryOperator returning null in case of exception.T - the type of the operands and result of the operatorE - the type of the potential exceptionfunction - the be uncheckedNullPointerException - if function is nullignore()Copyright © 2019. All rights reserved.