Interface TemplateRegistry<E extends Template>
This interface provides functionality to get available
Template
s. The Template
can be returned
localized depending on locale parameter. When the parameter is not specified or there is no such localization
resources the returned template is localized with default locale.- Author:
- Yordan Mihaylov - Initial contribution, Ana Dimova - Initial contribution, Vasil Ilchev - Initial contribution
-
Method Summary
Modifier and TypeMethodDescription@Nullable E
Gets a template specified by unique identifier.Gets all available templates, localized by specified locale.Gets the templates filtered by tag.Gets the templates filtered by tag.Gets the templates filtered by tags.Gets the templates filtered by tags.Methods inherited from interface org.openhab.core.common.registry.Registry
add, addRegistryChangeListener, get, getAll, remove, removeRegistryChangeListener, stream, update
-
Method Details
-
get
Gets a template specified by unique identifier.- Parameters:
uid
- the unique identifier in scope of registered templates.locale
- specifies the desiredLocale
to be used for localization of the returned element. If localization resources for this locale are not available or the passed locale isnull
the element is returned with the default localization.- Returns:
- the desired template instance or
null
if a template with such UID does not exist or the passed UID isnull
.
-
getByTag
Gets the templates filtered by tag.- Parameters:
tag
- determines the tag that the templates must have, to be included in the returned result. If it isnull
then the result will contain all available templates.- Returns:
- a collection of templates, which correspond to the specified tag.
-
getByTag
Gets the templates filtered by tag.- Parameters:
tag
- determines the tag that the templates must have, to be included in the returned result. If it isnull
then the result will contain all available templates.locale
- specifies the desiredLocale
to be used for localization of the returned elements. If localization resources for this locale are not available or the passed locale isnull
the elements are returned with the default localization.- Returns:
- a collection of localized templates, which correspond to the specified tag.
-
getByTags
Gets the templates filtered by tags.- Parameters:
tags
- determines the set of tags that the templates must have, to be included in the returned result. If it isnull
then the result will contain all templates.- Returns:
- a collection of templates, which correspond to the specified set of tags.
-
getByTags
Gets the templates filtered by tags.- Parameters:
locale
- specifies the desiredLocale
to be used for localization of the returned elements. If localization resources for this locale are not available or the passed locale isnull
the elements are returned with the default localization.tags
- determines the set of tags that the templates must have, to be included in the returned result. If it isnull
then the result will contain all templates.- Returns:
- the templates, which correspond to the specified set of tags.
-
getAll
Gets all available templates, localized by specified locale.- Parameters:
locale
- specifies the desiredLocale
to be used for localization of the returned elements. If localization resources for this locale are not available or the passed locale isnull
the elements are returned with the default localization.- Returns:
- a collection of localized templates, corresponding to the parameterized type.
-