Package org.openhab.core.common.registry
Interface ManagedProvider<E extends Identifiable<K>,K>
- Type Parameters:
E
- type of the elementK
- type of the element key
- All Superinterfaces:
Provider<E>
- All Known Subinterfaces:
ManagedMetadataProvider
- All Known Implementing Classes:
AbstractManagedProvider
,DefaultAbstractManagedProvider
,ManagedItemChannelLinkProvider
,ManagedItemProvider
,ManagedPersistenceServiceConfigurationProvider
,ManagedRuleProvider
,ManagedSemanticTagProvider
,ManagedThingProvider
,ManagedTransformationProvider
,ScriptedRuleProvider
@NonNullByDefault
public interface ManagedProvider<@NonNull E extends Identifiable<@NonNull K>,@NonNull K>
extends Provider<E>
The
ManagedProvider
is a specific Provider
that enables to
add, remove and update elements at runtime.- Author:
- Dennis Nobel - Initial contribution
-
Method Summary
Methods inherited from interface org.openhab.core.common.registry.Provider
addProviderChangeListener, getAll, removeProviderChangeListener
-
Method Details
-
add
Adds an element.- Parameters:
element
- element to be added
-
remove
Removes an element and returns the removed element.- Parameters:
key
- key of the element that should be removed- Returns:
- element that was removed, or null if no element with the given key exists
-
update
Updates an element.- Parameters:
element
- element to be updated- Returns:
- returns the old element or null if no element with the same key exists
-
get
Returns an element for the given key or null if no element for the given key exists.- Parameters:
key
- key- Returns:
- returns element or null, if no element for the given key exists
-