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> T
Will look up the instance of the functional interface by name and type which can only be Supplier, Consumer or Function.<T> T
default <T> T
Will look up the instance of the functional interface by name only.default <T> T
Will look up the instance of the functional interface by name only.default int
size()
Return the count of functions registered in this catalog.
-
Method Details
-
lookup
Will look up the instance of the functional interface by name only.- Type Parameters:
T
- instance type- 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. . .
TheacceptedOutputMimeTypes
are the string representation ofMimeType
where 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 toMessage<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
,Function
orConsumer
.- Parameters:
functionDefinition
- the definition of a function (e.g., 'foo' or 'foo|bar')acceptedOutputMimeTypes
- acceptedOutputMimeTypes array of string representation ofMimeType
s used to convert function output back toMessage<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
-