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