Change FunctionCatalog to key off Class<?>
Makes it possible to support other "function" types in the future. The user is always taking a risk with the lookup that the object returned has the generic type desired (but that hasn't changed with this commit). FunctionCatalog is a lot simpler as a result and also a lot more flexible.
This commit is contained in:
@@ -45,12 +45,9 @@ public class TaskConfiguration {
|
||||
|
||||
@Bean
|
||||
public CommandLineRunner commandLineRunner(FunctionCatalog registry) {
|
||||
final Supplier<Flux<Object>> supplier = registry
|
||||
.lookupSupplier(properties.getSupplier());
|
||||
final Function<Flux<Object>, Flux<Object>> function = registry
|
||||
.lookupFunction(properties.getFunction());
|
||||
final Consumer<Flux<Object>> consumer = registry
|
||||
.lookupConsumer(properties.getConsumer());
|
||||
final Supplier<Flux<Object>> supplier = registry.lookup(Supplier.class, properties.getSupplier());
|
||||
final Function<Flux<Object>, Flux<Object>> function = registry.lookup(Function.class, properties.getFunction());
|
||||
final Consumer<Flux<Object>> consumer = registry.lookup(Consumer.class, properties.getConsumer());
|
||||
CommandLineRunner runner = new CommandLineRunner() {
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user