public interface FunctionCatalog
Modifier and Type | Method and Description |
---|---|
Set<String> |
getNames(Class<?> type) |
<T> T |
lookup(Class<?> type,
String functionDefinition)
Will look up the instance of the functional interface by name and type which
can only be Supplier, Consumer or Function.
|
default <T> T |
lookup(String functionDefinition)
Will look up the instance of the functional interface by name only.
|
default <T> T |
lookup(String functionDefinition,
String... acceptedOutputMimeTypes)
Will look up the instance of the functional interface by name only.
|
default int |
size()
Return the count of functions registered in this catalog.
|
default <T> T lookup(String functionDefinition, String... acceptedOutputMimeTypes)
Message<byte[]>
. Function<Message<byte[]>, Message<byte[]>>
or
Function<Flux<Message<byte[]>>, Flux<Message<byte[]>>>
or
Consumer<Flux<Message<Flux<Message<byte[]>>>
etc. . .
acceptedOutputMimeTypes
are the string representation of MimeType
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
to Message<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...
).T
- instance type which should be one of Supplier
, Function
or Consumer
.functionDefinition
- the definition of a function (e.g., 'foo' or 'foo|bar')acceptedOutputMimeTypes
- acceptedOutputMimeTypes array of string representation of MimeType
s
used to convert function output back to Message<byte[]>
.default <T> T lookup(String functionDefinition)
T
- instance typefunctionDefinition
- the definition of the functional interface. Must
not be null;<T> T lookup(Class<?> type, String functionDefinition)
T
- instance typetype
- the type of functional interface. Can be nullfunctionDefinition
- the definition of the functional interface. Must
not be null;default int size()
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.