com.comtrade.ecm.engine.util

## Class ClassUtils

- java.lang.Object
- - com.comtrade.ecm.engine.util.ClassUtils

-     public class ClassUtils
      extends java.lang.Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `extendsClass(java.lang.Class<?> childClass, java.lang.Class<?> parentClass)` Determines if the class or interface represented by parentClass object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified childClass parameter.
    `static boolean` | `extendsClass(java.lang.Object object, java.lang.Class<?> parentClass)` Determines if the class or interface represented by parentClass object is either the same as, or is a superclass or superinterface of, the class of the object
    `static java.util.List<java.lang.Class<?>>` | `findClasses(java.io.File directory, java.lang.String packageName)` Recursive method used to find all classes in a given directory and subdirs.
    `static <T> java.lang.reflect.Constructor<T>` | `findConstructor(java.lang.Class<T> constructorClass, java.lang.Class<?> parameterClass)` Finds a constructor in a constructorClass that takes a parameter of parameterClass
    `static java.util.Collection<java.lang.Class<?>>` | `getAllInterfaces(java.lang.Class<?> clazz)`
    `static java.util.List<java.lang.Class<?>>` | `getClasses(java.lang.String sourceFolderPath, java.lang.String packageName)` Scans all classes accessible from the context class loader which belong to the given package and subpackages.
    `static boolean` | `implementsInterface(java.lang.Class<?> clazz, java.lang.Class<?> interfaceClass)` Gives an information if a class implements a particular interface.
    `static boolean` | `implementsInterface(java.lang.Object object, java.lang.Class<?> interfaceClass)` Gives an information if an object implements a particular interface.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getClasses

          public static java.util.List<java.lang.Class<?>> getClasses(java.lang.String sourceFolderPath,
                                                                      java.lang.String packageName)

      Scans all classes accessible from the context class loader which belong to the given package and subpackages.
      Parameters:
        `sourceFolderPath` - Path of a source folder of a root-package
        `packageName` - The base package
      Returns:
        The classes

    - #### findClasses

          public static java.util.List<java.lang.Class<?>> findClasses(java.io.File directory,
                                                                       java.lang.String packageName)

      Recursive method used to find all classes in a given directory and subdirs.
      Parameters:
        `directory` - The base directory
        `packageName` - The package name for classes found inside the base
      Returns:
        The classes

    - #### implementsInterface

          public static boolean implementsInterface(java.lang.Class<?> clazz,
                                                    java.lang.Class<?> interfaceClass)

      Gives an information if a class implements a particular interface.
      Parameters:
        `clazz` - to be tested
        `interfaceClass` - An interface class
      Returns:
        `true`, if it does
        `false`, otherwise
        `false`, if a clazz or an interfaceClass is `null`
        `false`, if a clazz or an interfaceClass is `null`
        `false`, if an interfaceClass is not an `interface`

    - #### implementsInterface

          public static boolean implementsInterface(java.lang.Object object,
                                                    java.lang.Class<?> interfaceClass)

      Gives an information if an object implements a particular interface.
      Parameters:
        `object` - An object
        `interfaceClass` - An interface class
      Returns:
        `true`, if it does
        `false`, otherwise
        `false`, if an object or an interface is `null`
        `false`, if an object or an interface is `null`
        `false`, if an interfaceClass is not an `interface`

    - #### extendsClass

          public static boolean extendsClass(java.lang.Class<?> childClass,
                                             java.lang.Class<?> parentClass)

      Determines if the class or interface represented by parentClass object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified childClass parameter.
      Parameters:
        `childClass` - A child class
        `parentClass` - A (potentially) parent class
      Returns:
        `true`, if it does
        `false`, otherwise
        `false`, if a childClass or a parentClass is `null`
        `false`, if a childClass or a parentClass is `null`

    - #### extendsClass

          public static boolean extendsClass(java.lang.Object object,
                                             java.lang.Class<?> parentClass)

      Determines if the class or interface represented by parentClass object is either the same as, or is a superclass or superinterface of, the class of the object
      Parameters:
        `object` - An object
        `parentClass` - A (potentially) parent class
      Returns:
        `true`, if it does
        `false`, otherwise
        `false`, if an object or a (super)class is `null`
        `false`, if an object or a (super)class is `null`

    - #### findConstructor

          public static <T> java.lang.reflect.Constructor<T> findConstructor(java.lang.Class<T> constructorClass,
                                                                             java.lang.Class<?> parameterClass)

      Finds a constructor in a constructorClass that takes a parameter of parameterClass
      Type Parameters:
        `T` - A type of an object that constructor creates
      Parameters:
        `constructorClass` - A class-object that defines a class of a constructor that we're looking for
        `parameterClass` - A class of a constructor's parameter
      Returns:
        A found constructor

    - #### getAllInterfaces

          public static java.util.Collection<java.lang.Class<?>> getAllInterfaces(java.lang.Class<?> clazz)