public class TypeArgumentsUtils extends Object
| Constructor and Description |
|---|
TypeArgumentsUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Class<?> |
getFirstTypeArgument(Class<T> baseClass,
Class<? extends T> childClass)
Gets the first type argument from the childClass.
|
static <T> Class<?> |
getTypeArgument(Class<T> baseClass,
Class<? extends T> childClass,
int index)
Gets the type argument from the childClass at the given index or null if it does not exists.
|
static <T> List<Class<?>> |
getTypeArguments(Class<T> baseClass,
Class<? extends T> childClass)
Get the actual type arguments a child class has used to extend a generic base class.
|
public static <T> Class<?> getFirstTypeArgument(Class<T> baseClass, Class<? extends T> childClass)
T - the generic type of the baseClassbaseClass - the base classchildClass - the child classpublic static <T> Class<?> getTypeArgument(Class<T> baseClass, Class<? extends T> childClass, int index)
T - the generic type of the baseClassbaseClass - the base classchildClass - the child classindex - the index of the type argumentpublic static <T> List<Class<?>> getTypeArguments(Class<T> baseClass, Class<? extends T> childClass)
T - the generic type of the baseClassbaseClass - the base classchildClass - the child classCopyright © 2007–2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.