Added initial implementation of check for supported function signatures

This commit is contained in:
Oleg Zhurakousky
2019-02-28 15:41:04 +01:00
parent 5f86e3ea1a
commit b48c7b5dc0
2 changed files with 26 additions and 0 deletions

View File

@@ -147,6 +147,7 @@ public class FunctionRegistration<T> implements BeanNameAware {
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public <S> FunctionRegistration<S> wrap() {
this.isFunctionSignatureSupported();
FunctionRegistration<S> result;
if (this.type == null) {
result = (FunctionRegistration<S>) this;
@@ -192,4 +193,12 @@ public class FunctionRegistration<T> implements BeanNameAware {
}
}
private void isFunctionSignatureSupported() {
if (type != null) {
Assert.isTrue(!(Mono.class.isAssignableFrom(this.type.getOutputWrapper())
&& Mono.class.isAssignableFrom(this.type.getInputWrapper())),
"Function<Mono, Mono> is not supported.");
}
}
}