Package com.hpe.caf.util
Class ModuleProvider
- java.lang.Object
-
- com.hpe.caf.util.ModuleProvider
-
public final class ModuleProvider extends Object
Allows retrieval of a module based on the Interface that it implements and its simple name.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ModuleProvidergetInstance()<T> TgetModule(Class<T> interfaceImplemented, String moduleType)Retrieves a module by its simple name, that implements a particular type T
-
-
-
Method Detail
-
getInstance
public static ModuleProvider 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.
-
-