Class ScriptedItemProvider
java.lang.Object
org.openhab.core.common.registry.AbstractProvider<Item>
org.openhab.core.automation.module.script.providersupport.shared.ScriptedItemProvider
- All Implemented Interfaces:
ManagedProvider<Item,,String> Provider<Item>,ItemProvider
@NonNullByDefault
public class ScriptedItemProvider
extends AbstractProvider<Item>
implements ItemProvider, ManagedProvider<Item,String>
This
ItemProvider keeps items provided by scripts during runtime.
This ensures that items are not kept on reboot, but have to be provided by the scripts again.- Author:
- Florian Hotze - Initial contribution
-
Field Summary
Fields inherited from class org.openhab.core.common.registry.AbstractProvider
listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an element.@Nullable ItemReturns an element for the given key or null if no element for the given key exists.getAll()Returns a collection of all elements.@Nullable ItemRemoves an element and returns the removed element.@Nullable ItemUpdates an element.Methods inherited from class org.openhab.core.common.registry.AbstractProvider
addProviderChangeListener, notifyListenersAboutAddedElement, notifyListenersAboutRemovedElement, notifyListenersAboutUpdatedElement, removeProviderChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openhab.core.common.registry.Provider
addProviderChangeListener, removeProviderChangeListener
-
Constructor Details
-
ScriptedItemProvider
public ScriptedItemProvider()
-
-
Method Details
-
getAll
Description copied from interface:ProviderReturns a collection of all elements. -
get
Description copied from interface:ManagedProviderReturns an element for the given key or null if no element for the given key exists.- Specified by:
getin interfaceManagedProvider<Item,String> - Parameters:
itemName- key- Returns:
- returns element or null, if no element for the given key exists
-
add
Description copied from interface:ManagedProviderAdds an element.- Specified by:
addin interfaceManagedProvider<Item,String> - Parameters:
item- element to be added
-
update
Description copied from interface:ManagedProviderUpdates an element.- Specified by:
updatein interfaceManagedProvider<Item,String> - Parameters:
item- element to be updated- Returns:
- returns the old element or null if no element with the same key exists
-
remove
Description copied from interface:ManagedProviderRemoves an element and returns the removed element.- Specified by:
removein interfaceManagedProvider<Item,String> - Parameters:
itemName- key of the element that should be removed- Returns:
- element that was removed, or null if no element with the given key exists
-