Interface FunctionCatalog
- All Known Subinterfaces:
FunctionRegistry
- All Known Implementing Classes:
BeanFactoryAwareFunctionRegistry, SimpleFunctionRegistry
public interface FunctionCatalog
- Author:
- Dave Syer, Oleg Zhurakousky
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> TWill look up the instance of the functional interface by name and type which can only be Supplier, Consumer or Function.<T> Tdefault <T> TWill look up the instance of the functional interface by name only.default <T> TWill look up the instance of the functional interface by name only.default intsize()Return the count of functions registered in this catalog.
-
Method Details
-
lookup
Will look up the instance of the functional interface by name only.- Parameters:
functionDefinition- the definition of the functional interface. Must not be null;- Returns:
- instance of the functional interface registered with this catalog
-
lookup
Will look up the instance of the functional interface by name and type which can only be Supplier, Consumer or Function. If type is not provided, the lookup will be made based on name only.- Type Parameters:
T- instance type- Parameters:
type- the type of functional interface. Can be nullfunctionDefinition- the definition of the functional interface. Must not be null;- Returns:
- instance of the functional interface registered with this catalog
-
lookup
Will look up the instance of the functional interface by name only. This lookup method assumes a very specific semantics which are: function sub-type(s) expected to beMessage<byte[]>.
For example,
Function<Message<byte[]>, Message<byte[]>>or
Function<Flux<Message<byte[]>>, Flux<Message<byte[]>>>or
Consumer<Flux<Message<Flux<Message<byte[]>>>etc. . .
TheacceptedOutputMimeTypesare the string representation ofwhere each mime-type in the provided array would correspond to the output with the same index (for cases of functions with multiple outputs) and is used to convert such output back toinvalid reference
MimeTypeMessage<byte[]>. If you need to provide several accepted types per specific output you can simply delimit them with comma (e.g.,application/json,text/plain...).- Type Parameters:
T- instance type which should be one ofSupplier,FunctionorConsumer.- Parameters:
functionDefinition- the definition of a function (e.g., 'foo' or 'foo|bar')acceptedOutputMimeTypes- acceptedOutputMimeTypes array of string representation ofs used to convert function output back toinvalid reference
MimeTypeMessage<byte[]>.- Returns:
- instance of the functional interface registered with this catalog
-
lookup
-
getNames
-
size
default int size()Return the count of functions registered in this catalog.- Returns:
- the count of functions registered in this catalog
-