Class ConfigDescription

java.lang.Object
org.openhab.core.config.core.ConfigDescription
All Implemented Interfaces:
Identifiable<URI>

@NonNullByDefault public class ConfigDescription extends Object implements Identifiable<URI>
The ConfigDescription class contains a description for a concrete configuration of e.g. a Thing, a Bridge or other specific configurable services. This class does not contain the configuration data itself and is usually used for data validation of the concrete configuration or for supporting user interfaces.

The ConfigDescriptionParameterGroup provides a method to group parameters to allow the UI to better display the parameter information. This can be left blank for small devices where there are only a few parameters, however devices with larger numbers of parameters can set the group member in the ConfigDescriptionParameter and then provide group information as part of the ConfigDescription class.

The description is stored within the ConfigDescriptionRegistry under the given URI. The URI has to follow the syntax '<scheme>:<token>[:<token>]' (e.g. "binding:hue:bridge").

Hint: This class is immutable.

Author:
Michael Grammling - Initial contribution, Dennis Nobel - Initial contribution, Chris Jackson - Added parameter groups, Thomas Höfer - Added convenient operation to get config description parameters in a map
  • Method Details

    • getUID

      public URI getUID()
      Returns the URI of this description within the ConfigDescriptionRegistry. The URI follows the syntax '<scheme>:<token>[:<token>]' (e.g. "binding:hue:bridge").
      Specified by:
      getUID in interface Identifiable<URI>
      Returns:
      the URI of this description
    • getParameters

      public List<ConfigDescriptionParameter> getParameters()
      Returns the corresponding ConfigDescriptionParameters.

      The returned list is immutable.

      Returns:
      the corresponding configuration description parameters (could be empty)
    • toParametersMap

      public Map<String,ConfigDescriptionParameter> toParametersMap()
      Returns a map representation of the ConfigDescriptionParameters. The map will use the name of the parameter as key and the parameter as value.
      Returns:
      the unmodifiable map of configuration description parameters which uses the name as key and the parameter as value (could be empty)
    • getParameterGroups

      public List<ConfigDescriptionParameterGroup> getParameterGroups()
      Returns the list of configuration parameter groups associated with the parameters.

      The returned list is immutable.

      Returns:
      the list of parameter groups parameter (could be empty)
    • toString

      public String toString()
      Overrides:
      toString in class Object