R - the type of the result of the functionE - the type of the potential exception of the functionExceptionHandlerSupport<R,E>, ObjectReturnExceptionHandlerSupport<IntFunction<R>,IntFunction<Optional<R>>,IntFunction<CompletionStage<R>>,R>@FunctionalInterface public interface IntFunctionWithException<R,E extends Exception> extends ObjectReturnExceptionHandlerSupport<IntFunction<R>,IntFunction<Optional<R>>,IntFunction<CompletionStage<R>>,R>
int-consuming primitive
specialization for FunctionWithException.
R apply(int value) throws E - The
functional method.IntFunction<R>IntFunction<Optional<R>>IntFunction<R>IntFunction| Modifier and Type | Method | Description |
|---|---|---|
R |
apply(int value) |
Applies this function to the given argument.
|
static <R,E extends Exception> |
failing(Supplier<E> exceptionBuilder) |
Returns a function that always throw exception.
|
default IntFunction<R> |
ignore() |
Converts this
IntFunctionWithException to a lifted
IntFunction returning null in case of exception. |
static <R,E extends Exception> |
ignored(IntFunctionWithException<R,E> function) |
Converts a
IntFunctionWithException to a lifted IntFunction
returning null in case of exception. |
default IntFunction<Optional<R>> |
lift() |
Converts this
IntFunctionWithException to a lifted
IntFunction using Optional as return value. |
static <R,E extends Exception> |
lifted(IntFunctionWithException<R,E> function) |
Converts a
IntFunctionWithException to a lifted IntFunction
using Optional as return value. |
default IntFunction<CompletionStage<R>> |
stage() |
Convert this
IntFunctionWithException to a lifted IntFunction
returning CompletionStage as return value. |
static <R,E extends Exception> |
staged(IntFunctionWithException<R,E> function) |
Convert this
IntFunctionWithException to a lifted IntFunction
returning CompletionStage as return value. |
default IntFunction<R> |
uncheck() |
Converts this
IntFunctionWithException to a IntFunction that
wraps exception to RuntimeException. |
static <R,E extends Exception> |
unchecked(IntFunctionWithException<R,E> function) |
Converts a
IntFunctionWithException to a IntFunction that
wraps exception to RuntimeException. |
static <R,E extends Exception> |
unchecked(IntFunctionWithException<R,E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
IntFunctionWithException to a IntFunction that
wraps exception to RuntimeException by using the provided mapping
function. |
exceptionMapper, exceptionMapperFornotThrowingHandler, staged, throwingHandler, uncheckedR apply(int value) throws E extends Exception
value - the function argumentE - any exceptionE extends ExceptionIntFunction.apply(int)default IntFunction<R> uncheck()
IntFunctionWithException to a IntFunction that
wraps exception to RuntimeException.uncheck in interface ExceptionHandlerSupport<R,E extends Exception>uncheck in interface ObjectReturnExceptionHandlerSupport<IntFunction<R>,IntFunction<Optional<R>>,IntFunction<CompletionStage<R>>,R>unchecked(IntFunctionWithException),
unchecked(IntFunctionWithException, Function)default IntFunction<Optional<R>> lift()
IntFunctionWithException to a lifted
IntFunction using Optional as return value.lift in interface ExceptionHandlerSupport<R,E extends Exception>lift in interface ObjectReturnExceptionHandlerSupport<IntFunction<R>,IntFunction<Optional<R>>,IntFunction<CompletionStage<R>>,R>lifted(IntFunctionWithException)default IntFunction<R> ignore()
IntFunctionWithException to a lifted
IntFunction returning null in case of exception.ignore in interface ExceptionHandlerSupport<R,E extends Exception>ignore in interface ObjectReturnExceptionHandlerSupport<IntFunction<R>,IntFunction<Optional<R>>,IntFunction<CompletionStage<R>>,R>ignored(IntFunctionWithException)default IntFunction<CompletionStage<R>> stage()
IntFunctionWithException to a lifted IntFunction
returning CompletionStage as return value.stage in interface ObjectReturnExceptionHandlerSupport<IntFunction<R>,IntFunction<Optional<R>>,IntFunction<CompletionStage<R>>,R>staged(IntFunctionWithException)static <R,E extends Exception> IntFunctionWithException<R,E> failing(Supplier<E> exceptionBuilder)
R - the type of the result of the functionE - the type of the exceptionexceptionBuilder - the supplier to create the exceptionstatic <R,E extends Exception> IntFunction<R> unchecked(IntFunctionWithException<R,E> function)
IntFunctionWithException to a IntFunction that
wraps exception to RuntimeException.R - the type of the result of the functionE - the type of the potential exceptionfunction - to be uncheckedNullPointerException - if function is nulluncheck(),
unchecked(IntFunctionWithException, Function)static <R,E extends Exception> IntFunction<R> unchecked(IntFunctionWithException<R,E> function, Function<Exception,RuntimeException> exceptionMapper)
IntFunctionWithException to a IntFunction that
wraps exception to RuntimeException by using the provided mapping
function.R - the type of the result of the functionE - 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(IntFunctionWithException)static <R,E extends Exception> IntFunction<Optional<R>> lifted(IntFunctionWithException<R,E> function)
IntFunctionWithException to a lifted IntFunction
using Optional as return value.R - the type of the result of the functionE - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nulllift()static <R,E extends Exception> IntFunction<R> ignored(IntFunctionWithException<R,E> function)
IntFunctionWithException to a lifted IntFunction
returning null in case of exception.R - the type of the result of the functionE - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullignore()static <R,E extends Exception> IntFunction<CompletionStage<R>> staged(IntFunctionWithException<R,E> function)
IntFunctionWithException to a lifted IntFunction
returning CompletionStage as return value.R - the type of the result of the functionE - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullstage()Copyright © 2019. All rights reserved.