Class ClassUtils

java.lang.Object
com.atlassian.plugin.util.ClassUtils

public class ClassUtils extends Object
Class utility methods
  • Method Details

    • findAllTypes

      public static Set<Class> findAllTypes(Class cls)
      Finds all super classes and interfaces for a given class
      Parameters:
      cls - The class to scan
      Returns:
      The collected related classes found
    • findAllTypes

      public static void findAllTypes(Class cls, Set<Class> types)
      Finds all super classes and interfaces for a given class
      Parameters:
      cls - The class to scan
      types - 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 class
      childClass - 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