org.aitools.programd.util
Class ClassUtils
java.lang.Object
org.aitools.programd.util.ClassUtils
public class ClassUtils
- extends Object
Contains utilities related to manipulating classes.
- Since:
- 4.5
- Author:
- Noel Bush
|
Method Summary |
static
|
getNewInstance(Class<T> theClass,
String description,
Object... constructorArgs)
Returns an instance of the given class,
instantiated using a constructor that takes the arguments given. |
static
|
getSubclassInstance(Class<T> baseType,
String classname,
String description,
Object... constructorArgs)
Returns the class which is a subclass of T,
instantiated using a constructor that takes the arguments given. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassUtils
public ClassUtils()
getSubclassInstance
public static <T> T getSubclassInstance(Class<T> baseType,
String classname,
String description,
Object... constructorArgs)
- Returns the class which is a subclass of
T,
instantiated using a constructor that takes the arguments given.
- Type Parameters:
T - the class of which the instantiated class must be a subclass- Parameters:
classname - the classname to instantiatebaseType - the base class typedescription - a short (one word or so) description of the desired classconstructorArgs - the arguments to the constructor (actual arguments, not types)
- Returns:
- the desired class
getNewInstance
public static <T> T getNewInstance(Class<T> theClass,
String description,
Object... constructorArgs)
- Returns an instance of the given class,
instantiated using a constructor that takes the arguments given.
- Type Parameters:
T - the type of the class- Parameters:
theClass - the class to instantiatedescription - a short (one word or so) description of the desired classconstructorArgs - the arguments to the constructor (actual arguments, not types)
- Returns:
- the desired class