Interface ContextualExecutor
- All Superinterfaces:
Executor
Facility for contextual execution.
- Author:
- Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TExecutes the specified caller with a given context.<V1,V2> void execute(BiConsumer<V1, V2> consumer, V1 value1, V2 value2) Executes the specified runner.<V1,V2, R> R execute(BiFunction<V1, V2, R> function, V1 value1, V2 value2) Executes the specified supplier with a given context.<V> voidExecutes the specified consumer using the specified value.<V,R> R Executes the specified supplier with a given context.<T> TExecutes the specified supplier with a given context.static <C> ContextualExecutorwithContextProvider(Supplier<Context<C>> provider) Creates a contextual executor from the specified context provider.
-
Method Details
-
execute
Executes the specified consumer using the specified value.- Type Parameters:
V- the consumed value type- Parameters:
consumer- a consumervalue- the consumed value
-
execute
Executes the specified runner.- Type Parameters:
V1- the 1st consumed value typeV2- the 2nd consumed value type- Parameters:
consumer- a consumervalue1- the 1st consumed valuevalue2- the 2nd consumed value
-
execute
-
execute
Executes the specified supplier with a given context.- Type Parameters:
T- the return type- Parameters:
supplier- a supplier task- Returns:
- the result of the supplier
-
execute
Executes the specified supplier with a given context.- Type Parameters:
V- the function parameter typeR- the function return type- Parameters:
function- a function to applyvalue- the function parameter- Returns:
- the result of the function
-
execute
Executes the specified supplier with a given context.- Type Parameters:
V1- the 1st function parameter typeV2- the 2nd function parameter typeR- the function return type- Parameters:
function- a function to applyvalue1- the 1st function parametervalue2- the 2nd function parameter- Returns:
- the result of the function
-
withContextProvider
Creates a contextual executor from the specified context provider.- Type Parameters:
C- the context type- Parameters:
provider- a supplier of a context- Returns:
- a contextual executor using the specified context provider.
-