Class RegistryChangedRunnableListener<E>

java.lang.Object
org.openhab.core.common.registry.RegistryChangedRunnableListener<E>
Type Parameters:
E - type of the element in the registry
All Implemented Interfaces:
RegistryChangeListener<E>

@NonNullByDefault public class RegistryChangedRunnableListener<E> extends Object implements RegistryChangeListener<E>
RegistryChangedRunnableListener can be added to Registry services, to execute a given Runnable on all types of changes.
Author:
Florian Hotze - Initial contribution
  • Constructor Details

    • RegistryChangedRunnableListener

      public RegistryChangedRunnableListener(Runnable runnable)
  • Method Details

    • added

      public void added(E element)
      Description copied from interface: RegistryChangeListener
      Notifies the listener that a single element has been added.
      Specified by:
      added in interface RegistryChangeListener<E>
      Parameters:
      element - the element that has been added
    • removed

      public void removed(E element)
      Description copied from interface: RegistryChangeListener
      Notifies the listener that a single element has been removed.
      Specified by:
      removed in interface RegistryChangeListener<E>
      Parameters:
      element - the element that has been removed
    • updated

      public void updated(E oldElement, E newElement)
      Description copied from interface: RegistryChangeListener
      Notifies the listener that a single element has been updated.
      Specified by:
      updated in interface RegistryChangeListener<E>
      Parameters:
      oldElement - the element that has been updated
      newElement - the new element