TypeInformation<?> returnType = ClassTypeInformation.fromReturnTypeOf(method);
return extractFromAccessibleObject(returnType, columnNameFor(method));
}
private String columnNameFor(Method method) {
ResultColumn column = method.getAnnotation(ResultColumn.class);
if (column != null) return column.value();
String name = method.getName();
if (name.startsWith("get")) name = name.substring(3);
return Character.toLowerCase(name.charAt(0)) + name.substring(1);
}