Package io.micronaut.function
Class DefaultLocalFunctionRegistry
java.lang.Object
io.micronaut.function.DefaultLocalFunctionRegistry
- All Implemented Interfaces:
io.micronaut.context.processor.AnnotationProcessor<FunctionBean,,io.micronaut.inject.ExecutableMethod<?, ?>> io.micronaut.context.processor.ExecutableMethodProcessor<FunctionBean>,LocalFunctionRegistry,io.micronaut.http.codec.MediaTypeCodecRegistry
@Singleton
public class DefaultLocalFunctionRegistry
extends Object
implements io.micronaut.context.processor.ExecutableMethodProcessor<FunctionBean>, LocalFunctionRegistry, io.micronaut.http.codec.MediaTypeCodecRegistry
Default implementation of the LocalFunctionRegistry interface
- Since:
- 1.0
-
Field Summary
Fields inherited from interface io.micronaut.function.LocalFunctionRegistry
FUNCTION_CHARSET, FUNCTION_NAME, FUNCTION_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionDefaultLocalFunctionRegistry(io.micronaut.http.codec.MediaTypeCodec... decoders) Constructor.DefaultLocalFunctionRegistry(io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry) Constructor.DefaultLocalFunctionRegistry(List<io.micronaut.http.codec.MediaTypeCodec> decoders) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionOptional<? extends io.micronaut.inject.ExecutableMethod<?,?>> Find the first available registered function.<T,U, R> Optional<io.micronaut.inject.ExecutableMethod<BiFunction<T, U, R>, R>> findBiFunction(String name) Find aBiFunctionfor the given name.Optional<io.micronaut.http.codec.MediaTypeCodec>findCodec(io.micronaut.http.MediaType mediaType) Optional<io.micronaut.http.codec.MediaTypeCodec>findConsumer(String name) Find aConsumerfor the given name.Optional<? extends io.micronaut.inject.ExecutableMethod<?,?>> Find the first available registered function.findFunction(String name) Find aFunctionfor the given name.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.Collection<io.micronaut.http.codec.MediaTypeCodec>voidprocess(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method)
-
Constructor Details
-
DefaultLocalFunctionRegistry
public DefaultLocalFunctionRegistry(io.micronaut.http.codec.MediaTypeCodec... decoders) Constructor.- Parameters:
decoders- decoders
-
DefaultLocalFunctionRegistry
Constructor.- Parameters:
decoders- decoders
-
DefaultLocalFunctionRegistry
public DefaultLocalFunctionRegistry(io.micronaut.http.codec.MediaTypeCodecRegistry codecRegistry) Constructor.- Parameters:
codecRegistry- codecRegistry
-
-
Method Details
-
findFirst
Description copied from interface:LocalFunctionRegistryFind the first available registered function.- Specified by:
findFirstin interfaceLocalFunctionRegistry- Returns:
- The
ExecutableMethodmethod representing the function
-
find
Description copied from interface:LocalFunctionRegistryFind the first available registered function.- Specified by:
findin interfaceLocalFunctionRegistry- Parameters:
name- the name- Returns:
- The
ExecutableMethodmethod representing the function
-
getAvailableFunctions
Description copied from interface:LocalFunctionRegistryA map of available functions with the key being the function name and the value being the function URI.- Specified by:
getAvailableFunctionsin interfaceLocalFunctionRegistry- Returns:
- A map of functions
-
findSupplier
Description copied from interface:LocalFunctionRegistryFind aSupplierfor the given name.- Specified by:
findSupplierin interfaceLocalFunctionRegistry- Type Parameters:
T- The type- Parameters:
name- The name- Returns:
- An
Optionalof aSupplier
-
findConsumer
public <T> Optional<io.micronaut.inject.ExecutableMethod<Consumer<T>,Void>> findConsumer(String name) Description copied from interface:LocalFunctionRegistryFind aConsumerfor the given name.- Specified by:
findConsumerin interfaceLocalFunctionRegistry- Type Parameters:
T- The type- Parameters:
name- The name- Returns:
- An
Optionalof aConsumer
-
findFunction
public <T,R> Optional<io.micronaut.inject.ExecutableMethod<Function<T,R>, findFunctionR>> (String name) Description copied from interface:LocalFunctionRegistryFind aFunctionfor the given name.- Specified by:
findFunctionin interfaceLocalFunctionRegistry- Type Parameters:
T- The typeR- The result of the method call- Parameters:
name- The name- Returns:
- An
Optionalof aFunction
-
findBiFunction
public <T,U, Optional<io.micronaut.inject.ExecutableMethod<BiFunction<T,R> U, findBiFunctionR>, R>> (String name) Description copied from interface:LocalFunctionRegistryFind aBiFunctionfor the given name.- Specified by:
findBiFunctionin interfaceLocalFunctionRegistry- 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
-
process
public void process(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?, ?> method) - Specified by:
processin interfaceio.micronaut.context.processor.AnnotationProcessor<FunctionBean,io.micronaut.inject.ExecutableMethod<?, ?>> - Specified by:
processin interfaceio.micronaut.context.processor.ExecutableMethodProcessor<FunctionBean>
-
findCodec
public Optional<io.micronaut.http.codec.MediaTypeCodec> findCodec(@Nullable io.micronaut.http.MediaType mediaType) - Specified by:
findCodecin interfaceio.micronaut.http.codec.MediaTypeCodecRegistry
-
findCodec
public Optional<io.micronaut.http.codec.MediaTypeCodec> findCodec(@Nullable io.micronaut.http.MediaType mediaType, Class<?> type) - Specified by:
findCodecin interfaceio.micronaut.http.codec.MediaTypeCodecRegistry
-
getCodecs
- Specified by:
getCodecsin interfaceio.micronaut.http.codec.MediaTypeCodecRegistry
-