Package io.micronaut.function
Interface LocalFunctionRegistry
- All Known Implementing Classes:
AnnotatedFunctionRouteBuilder
,DefaultLocalFunctionRegistry
public interface LocalFunctionRegistry
A registry of defined FunctionBean
instances containing within the current running application.
This interface is designed to allow the location and interaction with non-remote functions
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescription<T,
R> Optional<? extends ExecutableMethod<T, R>> Find the first available registered function.<T,
U, R> Optional<ExecutableMethod<BiFunction<T, U, R>, R>> findBiFunction
(String name) Find aBiFunction
for the given name.<T> Optional<ExecutableMethod<Consumer<T>,
Void>> findConsumer
(String name) Find aConsumer
for the given name.<T,
R> Optional<? extends ExecutableMethod<T, R>> Find the first available registered function.<T,
R> Optional<ExecutableMethod<Function<T, R>, R>> findFunction
(String name) Find aFunction
for the given name.<T> Optional<ExecutableMethod<Supplier<T>,
T>> findSupplier
(String name) Find aSupplier
for the given name.A map of available functions with the key being the function name and the value being the function URI.
-
Field Details
-
FUNCTION_NAME
The name of the default function name.- See Also:
-
FUNCTION_CHARSET
The name of the default function name.- See Also:
-
FUNCTION_PREFIX
Prefix used to identify function names.- See Also:
-
-
Method Details
-
getAvailableFunctions
A map of available functions with the key being the function name and the value being the function URI.- Returns:
- A map of functions
-
findFirst
Find the first available registered function.- Type Parameters:
T
- The declaring typeR
- The result of the method call- Returns:
- The
ExecutableMethod
method representing the function
-
find
Find the first available registered function.- Type Parameters:
T
- The declaring typeR
- The result of the method call- Parameters:
name
- the name- Returns:
- The
ExecutableMethod
method representing the function
-
findSupplier
Find aSupplier
for the given name. -
findConsumer
Find aConsumer
for the given name. -
findFunction
Find aFunction
for the given name. -
findBiFunction
Find aBiFunction
for the given name.- Type Parameters:
T
- The typeU
- the type of the second argument to the functionR
- The result of the method call- Parameters:
name
- The name- Returns:
- An
Optional
of aBiFunction
-