Add get*Names() to FunctionCatalog

We could go wit a separate interface, but it seems sensible to
keep it together really, so that callers don't have to downcast.
This commit is contained in:
Dave Syer
2017-06-29 10:25:31 +01:00
parent 2dd7dfb900
commit da0c954135
7 changed files with 69 additions and 36 deletions

View File

@@ -16,6 +16,8 @@
package org.springframework.cloud.function.registry;
import java.util.Collections;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
@@ -30,4 +32,10 @@ public interface FunctionCatalog {
<T, R> Function<T, R> lookupFunction(String name);
<T> Consumer<T> lookupConsumer(String name);
default Set<String> getSupplierNames() { return Collections.emptySet(); }
default Set<String> getFunctionNames() { return Collections.emptySet(); }
default Set<String> getConsumerNames() { return Collections.emptySet(); }
}