Class ZeroArgumentsConstructorUseCaseInstantiator
- java.lang.Object
-
- de.quantummaid.eventmaid.usecases.usecaseadapter.usecaseinstantiating.ZeroArgumentsConstructorUseCaseInstantiator
-
- All Implemented Interfaces:
UseCaseInstantiator
public final class ZeroArgumentsConstructorUseCaseInstantiator extends Object implements UseCaseInstantiator
ThisUseCaseInstantiatortakes the current use caseClassand locates its constructor withClass.getDeclaredConstructor(Class[])with no arguments. It fails withZeroArgumentsConstructorUseCaseInstantiatorExceptionif no suitable constructor was found.
-
-
Constructor Summary
Constructors Constructor Description ZeroArgumentsConstructorUseCaseInstantiator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tinstantiate(Class<T> type)This method is called, whenever a use case is to be invoked.static ZeroArgumentsConstructorUseCaseInstantiatorzeroArgumentsConstructorUseCaseInstantiator()Factory method to create a newZeroArgumentsConstructorUseCaseInstantiator.
-
-
-
Method Detail
-
zeroArgumentsConstructorUseCaseInstantiator
public static ZeroArgumentsConstructorUseCaseInstantiator zeroArgumentsConstructorUseCaseInstantiator()
Factory method to create a newZeroArgumentsConstructorUseCaseInstantiator.- Returns:
- the newly created
ZeroArgumentsConstructorUseCaseInstantiator
-
instantiate
public <T> T instantiate(Class<T> type)
Description copied from interface:UseCaseInstantiatorThis method is called, whenever a use case is to be invoked. It takes the use case's class and returns an instance of the use case.- Specified by:
instantiatein interfaceUseCaseInstantiator- Type Parameters:
T- the type of the use case- Parameters:
type- the class of the use case- Returns:
- the instance of the use case
-
-