E - the type of the potential exception of the functionExceptionHandlerSupport<F,F>, PrimitiveReturnExceptionHandlerSupport<IntUnaryOperator>@FunctionalInterface public interface IntUnaryOperatorWithException<E extends Exception> extends PrimitiveReturnExceptionHandlerSupport<IntUnaryOperator>
int-valued operand that produces
an int-valued result and may throws exception. This is the primitive
type specialization of UnaryOperatorWithException for int.
int applyAsInt(int operand) throws
E - The functional method.IntUnaryOperatorIntUnaryOperatorIntUnaryOperatorIntUnaryOperator| Modifier and Type | Method | Description |
|---|---|---|
default IntUnaryOperatorWithException<E> |
andThen(IntUnaryOperatorWithException<? extends E> after) |
Returns a composed operator that first applies this operator to its input,
and then applies the
after operator to the result. |
int |
applyAsInt(int operand) |
Applies this operator to the given operand.
|
default IntUnaryOperatorWithException<E> |
compose(IntUnaryOperatorWithException<? extends E> before) |
Returns a composed operator that first applies the
before operator to
its input, and then applies this operator to the result. |
static <E extends Exception> |
failing(Supplier<E> exceptionBuilder) |
Returns a function that always throw exception.
|
static <E extends Exception> |
identity() |
Returns a unary operator that always returns its input argument.
|
static <E extends Exception> |
ignored(IntUnaryOperatorWithException<E> function) |
Converts a
IntUnaryOperatorWithException to a lifted
IntUnaryOperator returning 0 in case of exception. |
static <E extends Exception> |
lifted(IntUnaryOperatorWithException<E> function) |
Converts a
IntUnaryOperatorWithException to a lifted
IntUnaryOperator using 0 as return value in case of error. |
static <E extends Exception> |
unchecked(IntUnaryOperatorWithException<E> function) |
Converts a
IntUnaryOperatorException to a IntUnaryOperator
that wraps exception to RuntimeException. |
static <E extends Exception> |
unchecked(IntUnaryOperatorWithException<E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
IntUnaryOperatorWithException to a
IntUnaryOperator that wraps exception to RuntimeException by
using the provided mapping function. |
default IntUnaryOperator |
uncheckOrIgnore(boolean uncheck) |
Used internally to implements the ignore or uncheck operation.
|
exceptionMapper, exceptionMapperForhandleException, ignore, lift, uncheckint applyAsInt(int operand)
throws E extends Exception
operand - the operandE - any exceptionE extends ExceptionIntUnaryOperator.applyAsInt(int)default IntUnaryOperator uncheckOrIgnore(boolean uncheck)
PrimitiveReturnExceptionHandlerSupportuncheckOrIgnore in interface PrimitiveReturnExceptionHandlerSupport<E extends Exception>uncheck - create unchecked version of the function when true, else ignored
version.default IntUnaryOperatorWithException<E> compose(IntUnaryOperatorWithException<? extends E> before)
before operator to
its input, and then applies this operator to the result. If evaluation of
either operator throws an exception, it is relayed to the caller of the
composed operator.before - the operator to apply before this operator is appliedbefore operator
and then applies this operatorNullPointerException - if before is nullandThen(IntUnaryOperatorWithException)default IntUnaryOperatorWithException<E> andThen(IntUnaryOperatorWithException<? extends E> after)
after operator to the result. If evaluation of
either operator throws an exception, it is relayed to the caller of the
composed operator.after - the operator to apply after this operator is appliedafter operatorNullPointerException - if after is nullcompose(IntUnaryOperatorWithException)static <E extends Exception> IntUnaryOperatorWithException<E> identity()
E - the exception that may be thrownstatic <E extends Exception> IntUnaryOperatorWithException<E> failing(Supplier<E> exceptionBuilder)
E - the type of the exceptionexceptionBuilder - the supplier to create the exceptionstatic <E extends Exception> IntUnaryOperator unchecked(IntUnaryOperatorWithException<E> function)
IntUnaryOperatorException to a IntUnaryOperator
that wraps exception to RuntimeException.E - the type of the potential exceptionfunction - to be uncheckedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.uncheck(),
unchecked(IntUnaryOperatorWithException, Function)static <E extends Exception> IntUnaryOperator unchecked(IntUnaryOperatorWithException<E> function, Function<Exception,RuntimeException> exceptionMapper)
IntUnaryOperatorWithException to a
IntUnaryOperator that wraps 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(IntUnaryOperatorWithException)static <E extends Exception> IntUnaryOperator lifted(IntUnaryOperatorWithException<E> function)
IntUnaryOperatorWithException to a lifted
IntUnaryOperator using 0 as return value in case of error.E - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.lift()static <E extends Exception> IntUnaryOperator ignored(IntUnaryOperatorWithException<E> function)
IntUnaryOperatorWithException to a lifted
IntUnaryOperator returning 0 in case of exception.E - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.ignore()Copyright © 2019. All rights reserved.