Package com.atlassian.plugin.util
Class ClassUtils
java.lang.Object
com.atlassian.plugin.util.ClassUtils
Class utility methods
-
Method Summary
Modifier and TypeMethodDescriptionfindAllTypes(Class cls) Finds all super classes and interfaces for a given classstatic voidfindAllTypes(Class cls, Set<Class> types) Finds all super classes and interfaces for a given classgetTypeArguments(Class<T> baseClass, Class<? extends T> childClass) Get the actual type arguments a child class has used to extend a generic base class.
-
Method Details
-
findAllTypes
Finds all super classes and interfaces for a given class- Parameters:
cls- The class to scan- Returns:
- The collected related classes found
-
findAllTypes
Finds all super classes and interfaces for a given class- Parameters:
cls- The class to scantypes- The collected related classes found
-
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.- Parameters:
baseClass- the base classchildClass- the child class- Returns:
- a list of the raw classes for the actual type arguments.
- Throws:
IllegalArgumentException- If the child class is not the base of the baseClass- Since:
- 2.5.0
-