How can I convert java.lang.reflect.Type
to Class<T> clazz
?
If I have one method as next which has an argument of Class<T>
:
public void oneMethod(Class<T> clazz) {
//Impl
}
Then another method which has an argument of java.lang.reflect.Type
and it calls oneMethod(Class<T> clazz)
and for it I need to convert java.lang.reflect.Type type
to Class<T>
:
public void someMehtod(java.lang.reflect.Type type) {
// I want to pass type arg to other method converted in Class<T>
otherMethod(¿How to convert java.lang.reflect.Type to Class<T>?);
}
Is it possible?