FunctionUtils polishing

- attempted to make code more functional (eat our own dog food) and concise
- addressed PR comment
- additional cleanup/polishing of FunctionUtils and related classes
- Removed Function/Supplier/ConsumerProxy classes by extending type info on their super interface
- Renamed FunctionUtils to FunctionFactoryUtils
- Added javadoc to FunctionFactoryUtils to explain its design considerations as well as what it can and can not doi

Fixes gh-90
This commit is contained in:
Oleg Zhurakousky
2017-07-14 16:36:50 -05:00
committed by Dave Syer
parent 2644ab3178
commit a973b678f1
21 changed files with 191 additions and 322 deletions

View File

@@ -24,8 +24,8 @@ import java.util.function.Supplier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.function.context.FunctionInspector;
import org.springframework.cloud.function.registry.FunctionCatalog;
import org.springframework.cloud.function.support.FunctionFactoryUtils;
import org.springframework.cloud.function.support.FluxFunction;
import org.springframework.cloud.function.support.FunctionUtils;
import reactor.core.publisher.Flux;
@@ -61,7 +61,7 @@ public class FunctionInitializer {
String type = this.properties.getType();
if ("function".equals(type)) {
this.function = this.catalog.lookupFunction(name);
if (this.function != null && !FunctionUtils.isFluxFunction(this.function)) {
if (this.function != null && !FunctionFactoryUtils.isFluxFunction(this.function)) {
// TODO: this shouldn't be necessary
this.function = new FluxFunction(this.function);
}