E - the type of the potential exception of the functionExceptionHandlerSupport<F,F>, PrimitiveReturnExceptionHandlerSupport<LongBinaryOperator>@FunctionalInterface public interface LongBinaryOperatorWithException<E extends Exception> extends PrimitiveReturnExceptionHandlerSupport<LongBinaryOperator>
long-valued operands and producing a
long-valued result which may throw exception. This is the primitive
type specialization of BinaryOperatorWithException for long.
long applyAsLong(long left, long
right) throws E - The functional method.LongBinaryOperatorLongBinaryOperatorLongBinaryOperatorLongBinaryOperator| Modifier and Type | Method | Description |
|---|---|---|
long |
applyAsLong(long left,
long right) |
Applies this operator to the given operands.
|
static <E extends Exception> |
failing(Supplier<E> exceptionBuilder) |
Returns a function that always throw exception.
|
static <E extends Exception> |
ignored(LongBinaryOperatorWithException<E> function) |
Converts a
LongBinaryOperatorWithException to a lifted
LongBinaryOperator with 0 as return value in case of
exception. |
static <E extends Exception> |
lifted(LongBinaryOperatorWithException<E> function) |
Converts a
LongBinaryOperatorWithException to a lifted
LongBinaryOperator with 0 as return value in case of
exception. |
static <E extends Exception> |
unchecked(LongBinaryOperatorWithException<E> function) |
Converts a
LongBinaryOperatorWithException to a
LongBinaryOperator that convert exception to
RuntimeException. |
static <E extends Exception> |
unchecked(LongBinaryOperatorWithException<E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
LongBinaryOperatorWithException to a
LongBinaryOperator that convert exception to RuntimeException
by using the provided mapping function. |
default LongBinaryOperator |
uncheckOrIgnore(boolean uncheck) |
Used internally to implements the ignore or uncheck operation.
|
exceptionMapper, exceptionMapperForhandleException, ignore, lift, unchecklong applyAsLong(long left,
long right)
throws E extends Exception
left - the first operandright - the second operandE - any exceptionE extends ExceptionLongBinaryOperator.applyAsLong(long, long)default LongBinaryOperator uncheckOrIgnore(boolean uncheck)
PrimitiveReturnExceptionHandlerSupportuncheckOrIgnore in interface PrimitiveReturnExceptionHandlerSupport<E extends Exception>uncheck - create unchecked version of the function when true, else ignored
version.static <E extends Exception> LongBinaryOperatorWithException<E> failing(Supplier<E> exceptionBuilder)
E - the type of the exceptionexceptionBuilder - the supplier to create the exceptionstatic <E extends Exception> LongBinaryOperator unchecked(LongBinaryOperatorWithException<E> function)
LongBinaryOperatorWithException to a
LongBinaryOperator that convert exception to
RuntimeException.E - the type of the potential exceptionfunction - to be uncheckedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.uncheck(),
unchecked(LongBinaryOperatorWithException, Function)static <E extends Exception> LongBinaryOperator unchecked(LongBinaryOperatorWithException<E> function, Function<Exception,RuntimeException> exceptionMapper)
LongBinaryOperatorWithException to a
LongBinaryOperator that convert exception to RuntimeException
by using the provided mapping function.E - 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 nullPrimitiveReturnExceptionHandlerSupport.uncheck(),
unchecked(LongBinaryOperatorWithException)static <E extends Exception> LongBinaryOperator lifted(LongBinaryOperatorWithException<E> function)
LongBinaryOperatorWithException to a lifted
LongBinaryOperator with 0 as return value in case of
exception.E - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.lift()static <E extends Exception> LongBinaryOperator ignored(LongBinaryOperatorWithException<E> function)
LongBinaryOperatorWithException to a lifted
LongBinaryOperator with 0 as return value in case of
exception.E - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.ignore()Copyright © 2019. All rights reserved.