Class FunctionRegistration<T>

java.lang.Object
org.springframework.cloud.function.context.FunctionRegistration<T>
Type Parameters:
T - target type
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

public class FunctionRegistration<T> extends Object implements org.springframework.beans.factory.BeanNameAware
Author:
Dave Syer, Oleg Zhurakousky
  • Field Details

    • REGISTRATION_NAME_SUFFIX

      public static String REGISTRATION_NAME_SUFFIX
      Suffix used to add to the name of FunctionRegistration bean that corresponds to the an actual function bean. It is often used when the actual function bean may not be a java Function (e.g., Kotlin) and certain custom wrapping is required.
      NOTE: This is not intended as oublis API
  • Constructor Details

    • FunctionRegistration

      public FunctionRegistration(T target, String... names)
      Creates instance of FunctionRegistration.
      Parameters:
      target - instance of Supplier, Function or Consumer
      names - additional set of names for this registration. Additional names can be provided name(String) or names(String...) operations.
  • Method Details

    • getProperties

      public Map<String,String> getProperties()
    • getNames

      public Set<String> getNames()
    • setNames

      public void setNames(Set<String> names)
      Will set the names for this registration clearing all previous names first. If you want to add a name or set or names to the existing set of names use names(Collection) or name(String) or names(String...) operations.
      Parameters:
      names - - bean names
    • getType

      public Type getType()
    • getTarget

      public T getTarget()
    • properties

      public FunctionRegistration<T> properties(Map<String,String> properties)
    • type

      public FunctionRegistration<T> type(Type type)
    • target

      public FunctionRegistration<T> target(T target)
      Allows to override the target of this registration with a new target that typically wraps the original target. This typically happens when original target is wrapped into its Flux counterpart (e.g., Function into FluxFunction)
      Parameters:
      target - new target
      Returns:
      this registration with new target
    • name

      public FunctionRegistration<T> name(String name)
    • names

      public FunctionRegistration<T> names(Collection<String> names)
    • names

      public FunctionRegistration<T> names(String... names)
    • setBeanName

      public void setBeanName(String name)
      Transforms (wraps) function identified by the 'target' to its Flux equivalent unless it already is. For example, Function<String, String> becomes Function<Flux<String>, Flux<String>>
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
      Type Parameters:
      S - the expected target type of the function (e.g., FluxFunction)