public interface ConstructorAccess
| Modifier and Type | Method and Description |
|---|---|
default <T> T |
castInstance(java.lang.Object... args)
Create a new instance of the target class with the given arguments and cast it to the wanted type.
|
java.lang.Class<?>[] |
getParameterTypes() |
java.lang.Object |
newInstance(java.lang.Object... args)
Create a new instance of the target class with the given arguments.
|
java.lang.Class<?>[] getParameterTypes()
Constructor.getParameterTypes()java.lang.Object newInstance(java.lang.Object... args)
args - The arguments to pass to the constructorConstructor.newInstance(Object...)default <T> T castInstance(java.lang.Object... args)
T - The type to cast the instance toargs - The arguments to pass to the constructorjava.lang.ClassCastException - If the instance cannot be casted to the wanted type