Package io.fabric8.crd.generator.utils
Class Generics
- java.lang.Object
-
- io.fabric8.crd.generator.utils.Generics
-
public class Generics extends Object
Generics utilities borrowed from sundrio's TypedVisitor class.
-
-
Constructor Summary
Constructors Constructor Description Generics()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Class<?>getClass(Type type)Get the underlying class for a type, or null if the type is a variable type.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.
-
-
-
Method Detail
-
getClass
public static Class<?> getClass(Type type)
Get the underlying class for a type, or null if the type is a variable type.- Parameters:
type- the type- Returns:
- the underlying class
-
getTypeArguments
public 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.- Type Parameters:
T- the type of the base class- Parameters:
baseClass- the base classchildClass- the child class- Returns:
- a list of the raw classes for the actual type arguments
-
-