I'm using Codemodel library for java-class generation. Is there a way to generate a generic method invocation which looks like this:
clazz.<String>get(value)
There is certainly a way of just casting a return result to a correct type using the following expression:
JExpr.cast(stringType, clazz.invoke("get").arg(value))
which results in
(String) clazz.get(value)
but the preferred way of casting is the first one, as this code is generating templates for further manual editing by developers.