public class ClassHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> Class<?> |
findParameterClass(int paramNum,
Class<? extends T> subclass,
Class<? extends T> classWithParameter)
find the runtime class for a class parameter.
|
static <T> List<Class<?>> |
findParameterClasses(Class<? extends T> subclass,
Class<? extends T> classWithParameter)
find the runtime classes of the parameters of a class or interface.
|
static Class<?> |
getClass(Type type)
when possible return the class of the type argument, otherwise null
|
static <T> Type |
getGenericSuperType(Class<? extends T> subclass,
Class<? extends T> classWithParameter)
returns either the generic superclass or a generic interface, but only when it is assignable from the typed
classWithParameter argument
|
public static <T> Class<?> findParameterClass(int paramNum, Class<? extends T> subclass, Class<? extends T> classWithParameter)
findParameterClasses(java.lang.Class, java.lang.Class)subclass - the subclass of the generic class whose parameter class we want to knowclassWithParameter - the class that contains the parameter whose class we are looking forpublic static <T> List<Class<?>> findParameterClasses(Class<? extends T> subclass, Class<? extends T> classWithParameter)
subclass - the subclass of the generic class whose parameter classes we want to knowclassWithParameter - the class that contains the parameter whose class we are looking forpublic static <T> Type getGenericSuperType(Class<? extends T> subclass, Class<? extends T> classWithParameter)
T - subclass - classWithParameter - Copyright © 2016 Glasnost. All rights reserved.