Class AbstractItemFileGenerator
java.lang.Object
org.openhab.core.items.fileconverter.AbstractItemFileGenerator
- All Implemented Interfaces:
ItemFileGenerator
@NonNullByDefault
public abstract class AbstractItemFileGenerator
extends Object
implements ItemFileGenerator
AbstractItemFileGenerator
is the base class for any Item
file generator.- Author:
- Laurent Garnier - Initial contribution
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
AbstractItemFileGenerator.ConfigParameter
is a container for any configuration parameter defined by a name and a value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChannelLinks
(Collection<Metadata> metadata, String itemName) Get the list of available channel links for an item, sorted by natural order of their channel UID.protected List
<AbstractItemFileGenerator.ConfigParameter> getConfigurationParameters
(Metadata metadata) Get the list of configuration parameters for a metadata, sorted by natural order of their names with the exception of the "stateDescription" namespace where "min", "max" and "step" parameters are provided at first in this order.protected @Nullable String
getDefaultStatePattern
(Item item) Get the default state pattern for an item.getMetadata
(Collection<Metadata> metadata, String itemName) Get the list of available metadata for an item, sorted by natural order of their namespaces.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openhab.core.items.fileconverter.ItemFileGenerator
generateFileFormat, getFileFormatGenerator
-
Constructor Details
-
AbstractItemFileGenerator
public AbstractItemFileGenerator()
-
-
Method Details
-
getChannelLinks
Get the list of available channel links for an item, sorted by natural order of their channel UID.- Parameters:
metadata
- a collection of metadataitemName
- the item name- Returns:
- the sorted list of metadata representing the channel links for this item
-
getMetadata
Get the list of available metadata for an item, sorted by natural order of their namespaces. The "semantics" and "channel" namespaces are ignored.- Parameters:
metadata
- a collection of metadataitemName
- the item name- Returns:
- the sorted list of metadata for this item
-
getConfigurationParameters
protected List<AbstractItemFileGenerator.ConfigParameter> getConfigurationParameters(Metadata metadata) Get the list of configuration parameters for a metadata, sorted by natural order of their names with the exception of the "stateDescription" namespace where "min", "max" and "step" parameters are provided at first in this order.- Parameters:
metadata
- the metadata- Returns:
- a sorted list of configuration parameters for the metadata
-
getDefaultStatePattern
Get the default state pattern for an item.- Parameters:
item
- the item- Returns:
- the default state pattern of null if no default
-