Class AbstractYamlFile

java.lang.Object
org.openhab.core.model.yaml.AbstractYamlFile
All Implemented Interfaces:
YamlFile

@NonNullByDefault public abstract class AbstractYamlFile extends Object implements 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 Details

    • version

      public int version
      YAML file version
  • Constructor Details

    • AbstractYamlFile

      public AbstractYamlFile()
  • Method Details

    • getElements

      public abstract List<? extends YamlElement> getElements()
      Description copied from interface: YamlFile
      Get the list of elements present in the YAML file.
      Specified by:
      getElements in interface YamlFile
      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 interface YamlFile
      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.
      Specified by:
      isValid in interface YamlFile
      Returns:
      true if all the checks are OK