T - the type of the input to the functionE - the type of the potential exception of the functionExceptionHandlerSupport<T,E>, PrimitiveReturnExceptionHandlerSupport<ToIntFunction<T>>@FunctionalInterface public interface ToIntFunctionWithException<T,E extends Exception> extends PrimitiveReturnExceptionHandlerSupport<ToIntFunction<T>>
int-producing primitive specialization for
FunctionWithException.
int applyAsInt(T value) throws
E - The functional method.ToIntFunction<T>ToIntFunction<T>ToIntFunction<T>ToIntFunction| Modifier and Type | Method | Description |
|---|---|---|
int |
applyAsInt(T value) |
Applies this function to the given argument.
|
static <T,E extends Exception> |
failing(Supplier<E> exceptionBuilder) |
Returns a function that always throw exception.
|
static <T,E extends Exception> |
ignored(ToIntFunctionWithException<T,E> function) |
Converts a
ToLongFunctionWithException to a lifted
ToIntFunction returning 0 in case of exception. |
static <T,E extends Exception> |
lifted(ToIntFunctionWithException<T,E> function) |
Converts a
ToLongFunctionWithException to a lifted
ToIntFunction returning 0 in case of exception. |
static <T,E extends Exception> |
unchecked(ToIntFunctionWithException<T,E> function) |
Converts a
ToIntFunctionException to a ToIntFunction that
wraps exception to RuntimeException. |
static <T,E extends Exception> |
unchecked(ToIntFunctionWithException<T,E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
ToLongFunctionWithException to a ToIntFunction
that wraps exception to RuntimeException by using the provided
mapping function. |
default ToIntFunction<T> |
uncheckOrIgnore(boolean uncheck) |
Used internally to implements the ignore or uncheck operation.
|
exceptionMapper, exceptionMapperForhandleException, ignore, lift, uncheckint applyAsInt(T value) throws E extends Exception
value - the function argumentE - any exceptionE extends ExceptionToIntFunction.applyAsInt(Object)default ToIntFunction<T> uncheckOrIgnore(boolean uncheck)
PrimitiveReturnExceptionHandlerSupportuncheckOrIgnore in interface PrimitiveReturnExceptionHandlerSupport<T>uncheck - create unchecked version of the function when true, else ignored
version.static <T,E extends Exception> ToIntFunctionWithException<T,E> failing(Supplier<E> exceptionBuilder)
T - the type of the input object to the functionE - the type of the exceptionexceptionBuilder - the supplier to create the exceptionstatic <T,E extends Exception> ToIntFunction<T> unchecked(ToIntFunctionWithException<T,E> function)
ToIntFunctionException to a ToIntFunction that
wraps exception to RuntimeException.T - the type of the input object to the functionE - the type of the potential exceptionfunction - to be uncheckedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.uncheck(),
unchecked(ToIntFunctionWithException, Function)static <T,E extends Exception> ToIntFunction<T> unchecked(ToIntFunctionWithException<T,E> function, Function<Exception,RuntimeException> exceptionMapper)
ToLongFunctionWithException to a ToIntFunction
that wraps exception to RuntimeException by using the provided
mapping function.T - the type of the input object to 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 nullPrimitiveReturnExceptionHandlerSupport.uncheck(),
unchecked(ToIntFunctionWithException)static <T,E extends Exception> ToIntFunction<T> lifted(ToIntFunctionWithException<T,E> function)
ToLongFunctionWithException to a lifted
ToIntFunction returning 0 in case of exception.T - the type of the input object to the functionE - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.lift()static <T,E extends Exception> ToIntFunction<T> ignored(ToIntFunctionWithException<T,E> function)
ToLongFunctionWithException to a lifted
ToIntFunction returning 0 in case of exception.T - the type of the input object to the functionE - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.ignore()Copyright © 2019. All rights reserved.