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