Package org.openhab.core.model.yaml
Class AbstractYamlFile
java.lang.Object
org.openhab.core.model.yaml.AbstractYamlFile
- All Implemented Interfaces:
YamlFile
The
AbstractYamlFile
is the DTO base class used to map a YAML configuration file.
A YAML configuration file consists of a version and a list of elements.- Author:
- Laurent Garnier - Initial contribution
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract List<? extends YamlElement>
Get the list of elements present in the YAML file.int
Get the version present in the YAML file.boolean
isValid()
Check that the file content is valid.
-
Field Details
-
version
public int versionYAML file version
-
-
Constructor Details
-
AbstractYamlFile
public AbstractYamlFile()
-
-
Method Details
-
getElements
Description copied from interface:YamlFile
Get the list of elements present in the YAML file.- Specified by:
getElements
in interfaceYamlFile
- Returns:
- the list of elements
-
getVersion
public int getVersion()Description copied from interface:YamlFile
Get the version present in the YAML file.- Specified by:
getVersion
in interfaceYamlFile
- Returns:
- the version in the file
-
isValid
public boolean isValid()Description copied from interface:YamlFile
Check that the file content is valid. It includes the check of duplicated elements (same identifier) and the check of each element.
-