T - the type of the input to the functionE - the type of the potential exception of the functionExceptionHandlerSupport<T,E>, PrimitiveReturnExceptionHandlerSupport<ToLongFunction<T>>@FunctionalInterface public interface ToLongFunctionWithException<T,E extends Exception> extends PrimitiveReturnExceptionHandlerSupport<ToLongFunction<T>>
long-producing primitive specialization for
FunctionWithException.
long applyAsLong(T value) throws
E - The functional method.ToLongFunction<T>ToLongFunction<T>ToLongFunction<T>ToLongFunction| Modifier and Type | Method | Description |
|---|---|---|
long |
applyAsLong(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(ToLongFunctionWithException<T,E> function) |
Converts a
ToLongFunctionWithException to a lifted
ToLongFunction returning 0 in case of exception. |
static <T,E extends Exception> |
lifted(ToLongFunctionWithException<T,E> function) |
Converts a
ToLongFunctionWithException to a lifted
ToLongFunction returning 0 in case of exception. |
static <T,E extends Exception> |
unchecked(ToLongFunctionWithException<T,E> function) |
Converts a
ToLongFunctionException to a ToLongFunction that
wraps exception to RuntimeException. |
static <T,E extends Exception> |
unchecked(ToLongFunctionWithException<T,E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
ToLongFunctionWithException to a ToLongFunction
that wraps exception to RuntimeException by using the provided
mapping function. |
default ToLongFunction<T> |
uncheckOrIgnore(boolean uncheck) |
Used internally to implements the ignore or uncheck operation.
|
exceptionMapper, exceptionMapperForhandleException, ignore, lift, unchecklong applyAsLong(T value) throws E extends Exception
value - the function argumentE - any exceptionE extends ExceptionToLongFunction.applyAsLong(Object)default ToLongFunction<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> ToLongFunctionWithException<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> ToLongFunction<T> unchecked(ToLongFunctionWithException<T,E> function)
ToLongFunctionException to a ToLongFunction 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(ToLongFunctionWithException, Function)static <T,E extends Exception> ToLongFunction<T> unchecked(ToLongFunctionWithException<T,E> function, Function<Exception,RuntimeException> exceptionMapper)
ToLongFunctionWithException to a ToLongFunction
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(ToLongFunctionWithException)static <T,E extends Exception> ToLongFunction<T> lifted(ToLongFunctionWithException<T,E> function)
ToLongFunctionWithException to a lifted
ToLongFunction 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> ToLongFunction<T> ignored(ToLongFunctionWithException<T,E> function)
ToLongFunctionWithException to a lifted
ToLongFunction 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.