Class AddonInfoRegistry

java.lang.Object
org.openhab.core.addon.AddonInfoRegistry

@NonNullByDefault public class AddonInfoRegistry extends Object
The AddonInfoRegistry provides access to AddonInfo objects. It tracks AddonInfoProvider OSGi services to collect all AddonInfo objects.
Author:
Dennis Nobel - Initial contribution, Michael Grammling - Initial contribution, added locale support
  • Constructor Details

    • AddonInfoRegistry

      public AddonInfoRegistry()
  • Method Details

    • addAddonInfoProvider

      protected void addAddonInfoProvider(AddonInfoProvider addonInfoProvider)
    • removeAddonInfoProvider

      public void removeAddonInfoProvider(AddonInfoProvider addonInfoProvider)
    • getAddonInfo

      public @Nullable AddonInfo getAddonInfo(String uid)
      Returns the add-on information for the specified add-on UID, or null if no add-on information could be found.
      Parameters:
      uid - the UID to be looked
      Returns:
      a add-on information object (could be null)
    • getAddonInfo

      public @Nullable AddonInfo getAddonInfo(String uid, @Nullable Locale locale)
      Returns the add-on information for the specified add-on UID and locale (language), or null if no add-on information could be found.

      If more than one provider provides information for the specified add-on UID and locale, it returns a new AddonInfo containing merged information from all such providers.

      Parameters:
      uid - the UID to be looked for
      locale - the locale to be used for the add-on information (could be null)
      Returns:
      a localized add-on information object (could be null)
    • getAddonInfos

      public Set<AddonInfo> getAddonInfos()
      Returns all add-on information this registry contains.
      Returns:
      a set of all add-on information this registry contains (not null, could be empty)
    • getAddonInfos

      public Set<AddonInfo> getAddonInfos(@Nullable Locale locale)
      Returns all add-on information in the specified locale (language) this registry contains.
      Parameters:
      locale - the locale to be used for the add-on information (could be null)
      Returns:
      a localized set of all add-on information this registry contains (not null, could be empty)