Class BaseModuleHandler<T extends Module>
java.lang.Object
org.openhab.core.automation.handler.BaseModuleHandler<T>
- All Implemented Interfaces:
ModuleHandler
- Direct Known Subclasses:
BaseActionModuleHandler,BaseConditionModuleHandler,BaseTriggerModuleHandler
@NonNullByDefault
public class BaseModuleHandler<T extends Module>
extends Object
implements ModuleHandler
This is a base class that can be used by any ModuleHandler implementation
- Author:
- Kai Kreuzer - Initial contribution
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()The method is called by RuleManager to free resources whenModuleHandleris released.protected ConfigurationReturns the configuration of the module.protected <C> CgetConfigAs(Class<C> configurationClass) Returns the configuration of the module and transforms it to the given class.voidsetCallback(ModuleHandlerCallback callback) The callback is injected to the handler through this method.
-
Field Details
-
module
-
callback
-
-
Constructor Details
-
BaseModuleHandler
-
-
Method Details
-
setCallback
Description copied from interface:ModuleHandlerThe callback is injected to the handler through this method.- Specified by:
setCallbackin interfaceModuleHandler- Parameters:
callback- aModuleHandlerCallbackinstance
-
dispose
public void dispose()Description copied from interface:ModuleHandlerThe method is called by RuleManager to free resources whenModuleHandleris released.- Specified by:
disposein interfaceModuleHandler
-
getConfig
Returns the configuration of the module.- Returns:
- configuration of the module
-
getConfigAs
Returns the configuration of the module and transforms it to the given class.- Parameters:
configurationClass- configuration class- Returns:
- configuration of module in form of the given class
-