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 Summary
Fields Modifier and Type Field Description static String
REGISTRATION_NAME_SUFFIX
Suffix used to add to the name of FunctionRegistration bean that corresponds to the an actual function bean.
-
Constructor Summary
Constructors Constructor Description FunctionRegistration(T target, String... names)
Creates instance of FunctionRegistration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getNames()
Map<String,String>
getProperties()
T
getTarget()
FunctionType
getType()
FunctionRegistration<T>
name(String name)
FunctionRegistration<T>
names(String... names)
FunctionRegistration<T>
names(Collection<String> names)
FunctionRegistration<T>
properties(Map<String,String> properties)
void
setBeanName(String name)
void
setNames(Set<String> names)
Will set the names for this registration clearing all previous names first.FunctionRegistration<T>
target(T target)
Allows to override the target of this registration with a new target that typically wraps the original target.FunctionRegistration<T>
type(Type type)
FunctionRegistration<T>
type(FunctionType type)
-
-
-
Field Detail
-
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 Detail
-
FunctionRegistration
public FunctionRegistration(T target, String... names)
Creates instance of FunctionRegistration.- Parameters:
target
- instance ofSupplier
,Function
orConsumer
names
- additional set of names for this registration. Additional names can be providedname(String)
ornames(String...)
operations.
-
-
Method Detail
-
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 usenames(Collection)
orname(String)
ornames(String...)
operations.- Parameters:
names
- - bean names
-
getType
public FunctionType getType()
-
getTarget
public T getTarget()
-
properties
public FunctionRegistration<T> properties(Map<String,String> properties)
-
type
public FunctionRegistration<T> type(Type type)
-
type
public FunctionRegistration<T> type(FunctionType 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 itsFlux
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)
- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
-