Package org.openhab.core.items
Interface MetadataRegistry
- All Superinterfaces:
Registry<Metadata,MetadataKey>
- All Known Implementing Classes:
ProviderMetadataRegistryDelegate
The MetadataRegistry is the central place, where additional information about items is kept.
Metadata can be supplied by
MetadataProviders, which can provision them from any source
they like and also dynamically remove or add data.- Author:
- Kai Kreuzer - Initial contribution
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionAdd element to metadatagetAllNamespaces(String itemname) Provides all namespaces of a particular itembooleanisInternalNamespace(String namespace) Determines whether the given namespace is internal.@Nullable Metadataremove(MetadataKey key) Remove element from metadatavoidremoveItemMetadata(String itemname) Remove all metadata of a given item@Nullable MetadataUpdate element in metadataMethods inherited from interface org.openhab.core.common.registry.Registry
addRegistryChangeListener, get, getAll, removeRegistryChangeListener, stream
-
Field Details
-
INTERNAL_NAMESPACE_PREFIX
- See Also:
-
-
Method Details
-
isInternalNamespace
Determines whether the given namespace is internal.- Parameters:
namespace- the metadata namespace to check- Returns:
trueif the given namespace is internal,falseotherwise
-
getAllNamespaces
Provides all namespaces of a particular item- Parameters:
itemname- the name of the item for which the namespaces should be searched.
-
removeItemMetadata
Remove all metadata of a given item- Parameters:
itemname- the name of the item for which the metadata is to be removed.
-
add
Add element to metadata- Specified by:
addin interfaceRegistry<Metadata,MetadataKey> - Parameters:
element- the element to add (must not be null)- Returns:
- the added element or newly created object of the same type
- Throws:
UnsupportedOperationException- if the metadata namespace has a reservedMetadataProviderthat is not aManagedProviderIllegalStateException- if no ManagedProvider is available
-
update
Update element in metadata- Specified by:
updatein interfaceRegistry<Metadata,MetadataKey> - Parameters:
element- the element to update (must not be null)- Returns:
- returns the old element or null if no element with the same key exists
- Throws:
UnsupportedOperationException- if the metadata namespace has a reservedMetadataProviderthat is not aManagedProviderIllegalStateException- if no ManagedProvider is available
-
remove
Remove element from metadata- Specified by:
removein interfaceRegistry<Metadata,MetadataKey> - Parameters:
key- the key of the element to remove (must not be null)- Returns:
- the removed element, or null if no element with the given key exists
- Throws:
UnsupportedOperationException- if the metadata namespace has a reservedMetadataProviderthat is not aManagedProviderIllegalStateException- if no ManagedProvider is available
-