Add "wrapper" type methods to FunctionInspector

These can be used to more reliably discover whether the user
has declared a function with flux types or "bare" POJOs. They
then pave the way to supporting single valued types in a special
way.

Also consolidate and simplify the logic in FunctionInspector
This commit is contained in:
Dave Syer
2017-05-24 09:08:30 +01:00
parent 719237e9c7
commit 0d2418a47b
11 changed files with 283 additions and 84 deletions

View File

@@ -60,7 +60,10 @@ public abstract class FunctionUtils {
}
String[] types = getParameterizedTypeNames(supplier, Supplier.class);
if (ObjectUtils.isEmpty(types)) {
return true;
// Assume if there is no generic information then the function is not
// expecting a flux. N.B. this isn't very accurate. It is better to use a
// FunctionInspector if one is available.
return false;
}
return (types[0].startsWith(FLUX_CLASS_NAME));
}