snippets.get-class.txt Maven / Gradle / Ivy
if (type instanceof Class) {
return (Class) type;
}
else if (type instanceof ParameterizedType) {
return getClass(((ParameterizedType) type).getRawType());
}
else if (type instanceof GenericArrayType) {
Type componentType = ((GenericArrayType) type).getGenericComponentType();
Class> componentClass = getClass(componentType);
if (componentClass != null ) {
return Array.newInstance(componentClass, 0).getClass();
}
else {
return null;
}
}
else {
return null;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy