Package io.micronaut.function
Interface LocalFunctionRegistry
-
- All Known Implementing Classes:
DefaultLocalFunctionRegistry
public interface LocalFunctionRegistryA registry of defined
FunctionBeaninstances containing within the current running application.This interface is designed to allow the location and interaction with non-remote functions
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFUNCTION_CHARSETThe name of the default function name.static java.lang.StringFUNCTION_NAMEThe name of the default function name.static java.lang.StringFUNCTION_PREFIXPrefix used to identify function names.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T,R>
java.util.Optional<? extends io.micronaut.inject.ExecutableMethod<T,R>>find(java.lang.String name)Find the first available registered function.<T,U,R>
java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.BiFunction<T,U,R>,R>>findBiFunction(java.lang.String name)Find aBiFunctionfor the given name.<T> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Consumer<T>,java.lang.Void>>findConsumer(java.lang.String name)Find aConsumerfor the given name.<T,R>
java.util.Optional<? extends io.micronaut.inject.ExecutableMethod<T,R>>findFirst()Find the first available registered function.<T,R>
java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Function<T,R>,R>>findFunction(java.lang.String name)Find aFunctionfor the given name.<T> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Supplier<T>,T>>findSupplier(java.lang.String name)Find aSupplierfor the given name.java.util.Map<java.lang.String,java.net.URI>getAvailableFunctions()A map of available functions with the key being the function name and the value being the function URI.
-
-
-
Field Detail
-
FUNCTION_NAME
static final java.lang.String FUNCTION_NAME
The name of the default function name.- See Also:
- Constant Field Values
-
FUNCTION_CHARSET
static final java.lang.String FUNCTION_CHARSET
The name of the default function name.- See Also:
- Constant Field Values
-
FUNCTION_PREFIX
static final java.lang.String FUNCTION_PREFIX
Prefix used to identify function names.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAvailableFunctions
java.util.Map<java.lang.String,java.net.URI> 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
<T,R> java.util.Optional<? extends io.micronaut.inject.ExecutableMethod<T,R>> 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
<T,R> java.util.Optional<? extends io.micronaut.inject.ExecutableMethod<T,R>> find(java.lang.String name)
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
<T> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Supplier<T>,T>> findSupplier(java.lang.String name)
Find aSupplierfor the given name.- Type Parameters:
T- The type- Parameters:
name- The name- Returns:
- An
Optionalof aSupplier
-
findConsumer
<T> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Consumer<T>,java.lang.Void>> findConsumer(java.lang.String name)
Find aConsumerfor the given name.- Type Parameters:
T- The type- Parameters:
name- The name- Returns:
- An
Optionalof aConsumer
-
findFunction
<T,R> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Function<T,R>,R>> findFunction(java.lang.String name)
Find aFunctionfor the given name.- Type Parameters:
T- The typeR- The result of the method call- Parameters:
name- The name- Returns:
- An
Optionalof aFunction
-
findBiFunction
<T,U,R> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.BiFunction<T,U,R>,R>> findBiFunction(java.lang.String name)
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
-
-