GH-317 Polishing and minor refactoring in AzureSpringBootHttpRequestHandler

- Moved convertOutput() to base class and added input value as an argument
- Added javadoc
- fixed checkstyle violations

Resolves #317
Resolves #360
This commit is contained in:
Oleg Zhurakousky
2019-04-29 13:46:13 +02:00
parent 27344d7098
commit f16a2c76cf
4 changed files with 32 additions and 56 deletions

View File

@@ -196,10 +196,15 @@ public abstract class AbstractSpringFunctionAdapterInitializer<C> implements Clo
return "";
}
//@SuppressWarnings("unchecked")
protected Object convertOutput(Object input, Object output) {
return output;
}
protected <O> O result(Object input, Publisher<?> output) {
List<Object> result = new ArrayList<>();
for (Object value : Flux.from(output).toIterable()) {
result.add(value);
result.add(this.convertOutput(input, value));
}
if (isSingleInput(getFunction(), input) && result.size() == 1) {
@SuppressWarnings("unchecked")