T - Type of the class to be instantiated.. class ConstructorClass<T>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<T> |
clazz |
private Constructor<T> |
constructor |
private java.lang.Class<?>[] |
parametersType |
| Constructor and Description |
|---|
ConstructorClass(java.lang.Class<T> clazz,
java.lang.Class<?>... parametersType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
Constructor<T> |
getConstructor()
Returns an instance of the generated class.
|
private Constructor<T> |
getInstance()
Gets the class to extend the Constructor interface.
|
int |
hashCode() |
private final java.lang.Class<T> clazz
private final java.lang.Class<?>[] parametersType
private Constructor<T> constructor
public ConstructorClass(java.lang.Class<T> clazz, java.lang.Class<?>... parametersType)
clazz - Type of the instance to be created.parametersType - Type of the parameters of the constructor to be invoked.public Constructor<T> getConstructor() throws java.lang.InstantiationException
java.lang.InstantiationException - If there is an error instantiating the class.private Constructor<T> getInstance() throws java.lang.InstantiationException
java.lang.InstantiationException - If there is an error instantiating the class.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object