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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
The method is called by RuleManager to free resources whenModuleHandler
is released.protected Configuration
Returns the configuration of the module.protected <C> C
getConfigAs
(Class<C> configurationClass) Returns the configuration of the module and transforms it to the given class.void
setCallback
(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:ModuleHandler
The callback is injected to the handler through this method.- Specified by:
setCallback
in interfaceModuleHandler
- Parameters:
callback
- aModuleHandlerCallback
instance
-
dispose
public void dispose()Description copied from interface:ModuleHandler
The method is called by RuleManager to free resources whenModuleHandler
is released.- Specified by:
dispose
in 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
-