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 Details

  • Constructor Details

    • BaseModuleHandler

      public BaseModuleHandler(T module)
  • Method Details

    • setCallback

      public void setCallback(ModuleHandlerCallback callback)
      Description copied from interface: ModuleHandler
      The callback is injected to the handler through this method.
      Specified by:
      setCallback in interface ModuleHandler
      Parameters:
      callback - a ModuleHandlerCallback instance
    • dispose

      public void dispose()
      Description copied from interface: ModuleHandler
      The method is called by RuleManager to free resources when ModuleHandler is released.
      Specified by:
      dispose in interface ModuleHandler
    • getConfig

      protected Configuration getConfig()
      Returns the configuration of the module.
      Returns:
      configuration of the module
    • getConfigAs

      protected <C> C getConfigAs(Class<C> configurationClass)
      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