Package org.wildfly.clustering.function
Interface Callable<T>
- Type Parameters:
T- the result type
- All Superinterfaces:
Callable<T>
An enhanced callable.
- Author:
- Paul Ferraro
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Callable<T> empty()Returns a callable that returns null.static <T> Callable<T> exceptional(Supplier<? extends Exception> exceptionProvider) Returns a callable that throws the provided exception.static <T> Callable<T> Returns a callable that delegates to the specified supplier.default <R> Callable<R> Returns a callable whose result is mapped by the specified function.static <T> Callable<T> of(T value) Returns a callable that returns the specified value.static <T> Callable<T> Returns a callable that runs the specified runner and returnsnull.
-
Field Details
-
NULL
-
-
Method Details
-
map
Returns a callable whose result is mapped by the specified function.- Type Parameters:
R- the mapped result type- Parameters:
mapper- a mapping function- Returns:
- a callable whose result is mapped by the specified function.
-
empty
Returns a callable that returns null.- Parameters:
value- the result value- Returns:
- a callable that returns null.
-
run
Returns a callable that runs the specified runner and returnsnull.- Parameters:
runner- a runner- Returns:
- a callable that runs the specified runner and returns
null.
-
get
Returns a callable that delegates to the specified supplier.- Parameters:
supplier- a supplier- Returns:
- the result of the specified supplier.
-
of
Returns a callable that returns the specified value.- Parameters:
value- the result value- Returns:
- a callable that returns the specified value.
-
exceptional
Returns a callable that throws the provided exception.- Parameters:
exceptionProvider- a provider of an exception- Returns:
- a callable that throws the provided exception.
-