Interface LocalFunctionRegistry

  • All Known Implementing Classes:
    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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FUNCTION_CHARSET
      The name of the default function name.
      static java.lang.String FUNCTION_NAME
      The name of the default function name.
      static java.lang.String FUNCTION_PREFIX
      Prefix 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 a BiFunction for 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 a Consumer for 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 a Function for the given name.
      <T> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Supplier<T>,​T>> findSupplier​(java.lang.String name)
      Find a Supplier for 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 type
        R - The result of the method call
        Returns:
        The ExecutableMethod method 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 type
        R - The result of the method call
        Parameters:
        name - the name
        Returns:
        The ExecutableMethod method representing the function
      • findSupplier

        <T> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Supplier<T>,​T>> findSupplier​(java.lang.String name)
        Find a Supplier for the given name.
        Type Parameters:
        T - The type
        Parameters:
        name - The name
        Returns:
        An Optional of a Supplier
      • findConsumer

        <T> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Consumer<T>,​java.lang.Void>> findConsumer​(java.lang.String name)
        Find a Consumer for the given name.
        Type Parameters:
        T - The type
        Parameters:
        name - The name
        Returns:
        An Optional of a Consumer
      • findFunction

        <T,​R> java.util.Optional<io.micronaut.inject.ExecutableMethod<java.util.function.Function<T,​R>,​R>> findFunction​(java.lang.String name)
        Find a Function for the given name.
        Type Parameters:
        T - The type
        R - The result of the method call
        Parameters:
        name - The name
        Returns:
        An Optional of a Function
      • 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 a BiFunction for the given name.
        Type Parameters:
        T - The type
        U - the type of the second argument to the function
        R - The result of the method call
        Parameters:
        name - The name
        Returns:
        An Optional of a BiFunction