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
Fields -
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 aBiFunctionfor the given name.<T> Optional<ExecutableMethod<Consumer<T>,Void>> findConsumer(String name) Find aConsumerfor 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 aFunctionfor the given name.<T> Optional<ExecutableMethod<Supplier<T>,T>> findSupplier(String name) Find aSupplierfor 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
ExecutableMethodmethod 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
ExecutableMethodmethod representing the function
-
findSupplier
Find aSupplierfor the given name. -
findConsumer
Find aConsumerfor the given name. -
findFunction
Find aFunctionfor the given name. -
findBiFunction
Find aBiFunctionfor 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
Optionalof aBiFunction
-