Package org.openhab.core.transform
Class ManagedTransformationProvider
java.lang.Object
org.openhab.core.common.registry.AbstractProvider<E>
org.openhab.core.common.registry.AbstractManagedProvider<Transformation,String,ManagedTransformationProvider.PersistedTransformation>
  
org.openhab.core.transform.ManagedTransformationProvider
- All Implemented Interfaces:
- ManagedProvider<Transformation,,- String> - Provider<Transformation>,- TransformationProvider
@NonNullByDefault
public class ManagedTransformationProvider
extends AbstractManagedProvider<Transformation,String,ManagedTransformationProvider.PersistedTransformation>
implements TransformationProvider  
The 
ManagedTransformationProvider implements a TransformationProvider for
 managed transformations stored in a JSON database- Author:
- Jan N. Klug - Initial contribution
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic class
- 
Field SummaryFields inherited from class org.openhab.core.common.registry.AbstractManagedProviderloggerFields inherited from class org.openhab.core.common.registry.AbstractProviderlisteners
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(Transformation element) Adds an element.protected StringReturns the name of storage, that is used to persist the elements.protected StringkeyToString(String key) Transforms the key into a string representation.protected @Nullable TransformationtoElement(String key, ManagedTransformationProvider.PersistedTransformation persistableElement) Converts the persistable element into the original element.toPersistableElement(Transformation element) Converts the original element into an element that can be persisted.@Nullable Transformationupdate(Transformation element) Updates an element.Methods inherited from class org.openhab.core.common.registry.AbstractManagedProviderget, getAll, removeMethods inherited from class org.openhab.core.common.registry.AbstractProvideraddProviderChangeListener, notifyListenersAboutAddedElement, notifyListenersAboutRemovedElement, notifyListenersAboutUpdatedElement, removeProviderChangeListenerMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openhab.core.common.registry.ProvideraddProviderChangeListener, getAll, removeProviderChangeListener
- 
Constructor Details- 
ManagedTransformationProvider
 
- 
- 
Method Details- 
getStorageNameDescription copied from class:AbstractManagedProviderReturns the name of storage, that is used to persist the elements.- Specified by:
- getStorageNamein class- AbstractManagedProvider<Transformation,- String, - ManagedTransformationProvider.PersistedTransformation> 
- Returns:
- name of the storage
 
- 
keyToStringDescription copied from class:AbstractManagedProviderTransforms the key into a string representation.- Specified by:
- keyToStringin class- AbstractManagedProvider<Transformation,- String, - ManagedTransformationProvider.PersistedTransformation> 
- Parameters:
- key- key
- Returns:
- string representation of the key
 
- 
toElementprotected @Nullable Transformation toElement(String key, ManagedTransformationProvider.PersistedTransformation persistableElement) Description copied from class:AbstractManagedProviderConverts the persistable element into the original element.- Specified by:
- toElementin class- AbstractManagedProvider<Transformation,- String, - ManagedTransformationProvider.PersistedTransformation> 
- Parameters:
- key- key
- persistableElement- persistable element
- Returns:
- original element
 
- 
toPersistableElementprotected ManagedTransformationProvider.PersistedTransformation toPersistableElement(Transformation element) Description copied from class:AbstractManagedProviderConverts the original element into an element that can be persisted.- Specified by:
- toPersistableElementin class- AbstractManagedProvider<Transformation,- String, - ManagedTransformationProvider.PersistedTransformation> 
- Parameters:
- element- original element
- Returns:
- persistable element
 
- 
addDescription copied from interface:ManagedProviderAdds an element.- Specified by:
- addin interface- ManagedProvider<Transformation,- String> 
- Overrides:
- addin class- AbstractManagedProvider<Transformation,- String, - ManagedTransformationProvider.PersistedTransformation> 
- Parameters:
- element- element to be added
 
- 
updateDescription copied from interface:ManagedProviderUpdates an element.- Specified by:
- updatein interface- ManagedProvider<Transformation,- String> 
- Overrides:
- updatein class- AbstractManagedProvider<Transformation,- String, - ManagedTransformationProvider.PersistedTransformation> 
- Parameters:
- element- element to be updated
- Returns:
- returns the old element or null if no element with the same key exists
 
 
-