T - the type of the input to the functionE - the type of the potential exception of the functionExceptionHandlerSupport<T,E>, PrimitiveReturnExceptionHandlerSupport<ToDoubleFunction<T>>@FunctionalInterface public interface ToDoubleFunctionWithException<T,E extends Exception> extends PrimitiveReturnExceptionHandlerSupport<ToDoubleFunction<T>>
double-producing primitive specialization for
FunctionWithException.
double applyAsDouble(T value) throws
E - The functional method.ToDoubleFunction<T>ToDoubleFunction<T>ToDoubleFunction<T>ToDoubleFunction| Modifier and Type | Method | Description |
|---|---|---|
double |
applyAsDouble(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(ToDoubleFunctionWithException<T,E> function) |
Converts a
ToDoubleFunctionWithException to a lifted
ToDoubleFunction returning 0 in case of exception. |
static <T,E extends Exception> |
lifted(ToDoubleFunctionWithException<T,E> function) |
Converts a
ToDoubleFunctionWithException to a lifted
ToDoubleFunction returning 0 in case of exception. |
static <T,E extends Exception> |
unchecked(ToDoubleFunctionWithException<T,E> function) |
Converts a
ToDoubleFunctionException to a ToDoubleFunction
that convert exception to RuntimeException. |
static <T,E extends Exception> |
unchecked(ToDoubleFunctionWithException<T,E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
ToDoubleFunctionWithException to a
ToDoubleFunction that convert exception to RuntimeException
by using the provided mapping function. |
default ToDoubleFunction<T> |
uncheckOrIgnore(boolean uncheck) |
Used internally to implements the ignore or uncheck operation.
|
exceptionMapper, exceptionMapperForhandleException, ignore, lift, uncheckdouble applyAsDouble(T value) throws E extends Exception
value - the function argumentE - any exceptionE extends ExceptionToDoubleFunction.applyAsDouble(Object)default ToDoubleFunction<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> ToDoubleFunctionWithException<T,E> failing(Supplier<E> exceptionBuilder)
T - the type of the input to the functionE - the type of the exceptionexceptionBuilder - the supplier to create the exceptionstatic <T,E extends Exception> ToDoubleFunction<T> unchecked(ToDoubleFunctionWithException<T,E> function)
ToDoubleFunctionException to a ToDoubleFunction
that convert exception to RuntimeException.T - the type of the input to the functionE - the type of the potential exceptionfunction - to be uncheckedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.uncheck(),
unchecked(ToDoubleFunctionWithException, Function)static <T,E extends Exception> ToDoubleFunction<T> unchecked(ToDoubleFunctionWithException<T,E> function, Function<Exception,RuntimeException> exceptionMapper)
ToDoubleFunctionWithException to a
ToDoubleFunction that convert exception to RuntimeException
by using the provided mapping function.T - the type of the input 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(ToDoubleFunctionWithException)static <T,E extends Exception> ToDoubleFunction<T> lifted(ToDoubleFunctionWithException<T,E> function)
ToDoubleFunctionWithException to a lifted
ToDoubleFunction returning 0 in case of exception.T - the type of the input to the functionE - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.lift()static <T,E extends Exception> ToDoubleFunction<T> ignored(ToDoubleFunctionWithException<T,E> function)
ToDoubleFunctionWithException to a lifted
ToDoubleFunction returning 0 in case of exception.T - the type of the input to the functionE - the type of the potential exceptionfunction - to be liftedNullPointerException - if function is nullPrimitiveReturnExceptionHandlerSupport.ignore()Copyright © 2019. All rights reserved.