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:
committed by
Dave Syer
parent
2644ab3178
commit
a973b678f1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user