Class ModuleProvider
java.lang.Object
com.github.cafapi.common.util.moduleloader.ModuleProvider
Allows retrieval of a module based on the Interface that it implements and its simple name.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleProvider<T> TRetrieves a module by its simple name, that implements a particular type T
-
Method Details
-
getInstance
-
getModule
public <T> T getModule(Class<T> interfaceImplemented, String moduleType) throws NullPointerException Retrieves a module by its simple name, that implements a particular type T- Parameters:
interfaceImplemented- The interface that 'moduleType' implements and that the result should be returned as.moduleType- Represents particular instance of a factory type object e.g. 'ExampleWorkerBuilder'- Returns:
- An instance of moduleType as the type T passed in.
- Throws:
NullPointerException- If the module cannot be retrieved with the specified moduleType.
-