Class AbstractProvider<E>

java.lang.Object
org.openhab.core.common.registry.AbstractProvider<E>
Type Parameters:
E - type of the provided elements
All Implemented Interfaces:
Provider<E>
Direct Known Subclasses:
AbstractManagedProvider, ScriptedRuleProvider

@NonNullByDefault public abstract class AbstractProvider<@NonNull E> extends Object implements Provider<E>
AbstractProvider can be used as base class for Provider implementations. It supports the registration and notification of listeners.
Author:
Dennis Nobel - Initial contribution
  • Field Details

  • Constructor Details

    • AbstractProvider

      public AbstractProvider()
  • Method Details

    • addProviderChangeListener

      public void addProviderChangeListener(ProviderChangeListener<@NonNull E> listener)
      Description copied from interface: Provider
      Adds a ProviderChangeListener which must be notified if there are changes concerning the elements provided by the Provider.
      Specified by:
      addProviderChangeListener in interface Provider<E>
      Parameters:
      listener - the listener to be added
    • removeProviderChangeListener

      public void removeProviderChangeListener(ProviderChangeListener<@NonNull E> listener)
      Description copied from interface: Provider
      Specified by:
      removeProviderChangeListener in interface Provider<E>
      Parameters:
      listener - the listener to be removed.
    • notifyListenersAboutAddedElement

      protected void notifyListenersAboutAddedElement(@NonNull E element)
    • notifyListenersAboutRemovedElement

      protected void notifyListenersAboutRemovedElement(@NonNull E element)
    • notifyListenersAboutUpdatedElement

      protected void notifyListenersAboutUpdatedElement(@NonNull E oldElement, @NonNull E element)