I need to generate a generic method like
public static <T extends SomeObject> T get(Class<T> type) {
...
return null;
}
Anybody done this before?
I need to generate a generic method like
public static <T extends SomeObject> T get(Class<T> type) {
...
return null;
}
Anybody done this before?
The key is the
JMethod#generify
method:Output:
(I used
Number
as the bound, but you can choose it arbitrarily)