R - the type of the result of the functionE - the type of the potential exception of the functionExceptionHandlerSupport<R,E>, ObjectReturnExceptionHandlerSupport<DoubleFunction<R>,DoubleFunction<Optional<R>>,DoubleFunction<CompletionStage<R>>,R>@FunctionalInterface public interface DoubleFunctionWithException<R,E extends Exception> extends ObjectReturnExceptionHandlerSupport<DoubleFunction<R>,DoubleFunction<Optional<R>>,DoubleFunction<CompletionStage<R>>,R>
double-consuming
primitive specialization for FunctionWithException.
R apply(double value) throws
E - The functional method.DoubleFunction<R>DoubleFunction<Optional<R>>DoubleFunction<R>DoubleFunction| Modifier and Type | Method | Description |
|---|---|---|
R |
apply(double 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 DoubleFunction<R> |
ignore() |
Converts this
DoubleFunctionWithException to a lifted
DoubleFunction returning null in case of exception. |
static <R,E extends Exception> |
ignored(DoubleFunctionWithException<R,E> function) |
Converts a
DoubleFunctionWithException to a lifted
DoubleFunction returning null in case of exception. |
default DoubleFunction<Optional<R>> |
lift() |
Converts this
DoubleFunctionWithException to a lifted
DoubleFunction using Optional as return value. |
static <R,E extends Exception> |
lifted(DoubleFunctionWithException<R,E> function) |
Converts a
DoubleFunctionWithException to a lifted
DoubleFunction using Optional as return value. |
default DoubleFunction<CompletionStage<R>> |
stage() |
Convert this
DoubleFunctionWithException to a lifted
DoubleFunction returning CompletionStage as return value. |
static <R,E extends Exception> |
staged(DoubleFunctionWithException<R,E> function) |
Convert this
DoubleFunctionWithException to a lifted
DoubleFunction return CompletionStage as return value. |
default DoubleFunction<R> |
uncheck() |
Converts this
DoubleFunctionWithException to a DoubleFunction
that wraps to RuntimeException. |
static <R,E extends Exception> |
unchecked(DoubleFunctionWithException<R,E> function) |
Converts a
DoubleFunctionWithException to a DoubleFunction
that wraps to RuntimeException. |
static <R,E extends Exception> |
unchecked(DoubleFunctionWithException<R,E> function,
Function<Exception,RuntimeException> exceptionMapper) |
Converts a
DoubleFunctionWithException to a DoubleFunction
that wraps to RuntimeException by using the provided mapping
function. |
exceptionMapper, exceptionMapperFornotThrowingHandler, staged, throwingHandler, uncheckedR apply(double value) throws E extends Exception
value - the function argumentE - any exceptionE extends ExceptionDoubleFunction.apply(double)default DoubleFunction<R> uncheck()
DoubleFunctionWithException to a DoubleFunction
that wraps to RuntimeException.uncheck in interface ExceptionHandlerSupport<R,E extends Exception>uncheck in interface ObjectReturnExceptionHandlerSupport<DoubleFunction<R>,DoubleFunction<Optional<R>>,DoubleFunction<CompletionStage<R>>,R>unchecked(DoubleFunctionWithException),
unchecked(DoubleFunctionWithException, Function)default DoubleFunction<Optional<R>> lift()
DoubleFunctionWithException to a lifted
DoubleFunction using Optional as return value.lift in interface ExceptionHandlerSupport<R,E extends Exception>lift in interface ObjectReturnExceptionHandlerSupport<DoubleFunction<R>,DoubleFunction<Optional<R>>,DoubleFunction<CompletionStage<R>>,R>lifted(DoubleFunctionWithException)default DoubleFunction<R> ignore()
DoubleFunctionWithException to a lifted
DoubleFunction returning null in case of exception.ignore in interface ExceptionHandlerSupport<R,E extends Exception>ignore in interface ObjectReturnExceptionHandlerSupport<DoubleFunction<R>,DoubleFunction<Optional<R>>,DoubleFunction<CompletionStage<R>>,R>ignored(DoubleFunctionWithException)default DoubleFunction<CompletionStage<R>> stage()
DoubleFunctionWithException to a lifted
DoubleFunction returning CompletionStage as return value.stage in interface ObjectReturnExceptionHandlerSupport<DoubleFunction<R>,DoubleFunction<Optional<R>>,DoubleFunction<CompletionStage<R>>,R>staged(DoubleFunctionWithException)static <R,E extends Exception> DoubleFunctionWithException<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> DoubleFunction<R> unchecked(DoubleFunctionWithException<R,E> function)
DoubleFunctionWithException to a DoubleFunction
that wraps 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(DoubleFunctionWithException, Function)static <R,E extends Exception> DoubleFunction<R> unchecked(DoubleFunctionWithException<R,E> function, Function<Exception,RuntimeException> exceptionMapper)
DoubleFunctionWithException to a DoubleFunction
that wraps 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(DoubleFunctionWithException)static <R,E extends Exception> DoubleFunction<Optional<R>> lifted(DoubleFunctionWithException<R,E> function)
DoubleFunctionWithException to a lifted
DoubleFunction 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> DoubleFunction<R> ignored(DoubleFunctionWithException<R,E> function)
DoubleFunctionWithException to a lifted
DoubleFunction 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> DoubleFunction<CompletionStage<R>> staged(DoubleFunctionWithException<R,E> function)
DoubleFunctionWithException to a lifted
DoubleFunction return 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.