Class NodeValue

java.lang.Object
org.openhab.core.config.core.xml.util.NodeValue
All Implemented Interfaces:
NodeName

@NonNullByDefault public class NodeValue extends Object implements NodeName
The NodeValue class contains the node name and its according value for an XML tag.

This class can be used for an intermediate conversion result of a single value for an XML tag. The conversion can be done by using the according NodeValueConverter.

Hint: This class is immutable.

Author:
Michael Grammling - Initial contribution
  • Constructor Details

    • NodeValue

      public NodeValue(String nodeName, @Nullable Map<String,String> attributes, @Nullable Object value) throws IllegalArgumentException
      Creates a new instance of this class with the specified parameters.
      Parameters:
      nodeName - the name of the node this object belongs to (must not be empty)
      attributes - the attributes of the node this object belongs to
      value - the value of the node this object belongs to
      Throws:
      IllegalArgumentException - if the name of the node is empty
  • Method Details

    • getNodeName

      public String getNodeName()
      Description copied from interface: NodeName
      Returns the name of the node this object belongs to.
      Specified by:
      getNodeName in interface NodeName
      Returns:
      the name of the node this object belongs to (not empty)
    • getAttributes

      public @Nullable Map<String,String> getAttributes()
      Returns the attributes of the node.
      Returns:
      the attributes of the node
    • getValue

      public @Nullable Object getValue()
      Returns the value of the node.
      Returns:
      the value of the node (could be null or empty)
    • toString

      public String toString()
      Overrides:
      toString in class Object