Strangle old inspector methods

Fixes gh-81
This commit is contained in:
Dave Syer
2017-07-12 14:29:44 +01:00
parent d7d49858f6
commit c8646d64d8
12 changed files with 123 additions and 186 deletions

View File

@@ -62,6 +62,7 @@ public class FunctionInitializer {
if ("function".equals(type)) {
this.function = this.catalog.lookupFunction(name);
if (this.function != null && !FunctionUtils.isFluxFunction(this.function)) {
// TODO: this shouldn't be necessary
this.function = new FluxFunction(this.function);
}
}
@@ -75,11 +76,16 @@ public class FunctionInitializer {
protected Class<?> getInputType() {
if (inspector != null) {
return inspector.getInputType(this.properties.getName());
return inspector.getInputType(function());
}
return Object.class;
}
private Object function() {
return this.function != null ? this.function
: (this.consumer != null ? this.consumer : this.supplier);
}
protected Flux<?> apply(Flux<?> input) {
if (this.function != null) {
return function.apply(input);