Class MappingNode

java.lang.Object

public class MappingNode
extends CollectionNode<NodeTuple>
Represents a map.

A map is a collection of unsorted key-value pairs.

  • Constructor Details

  • Method Details

    • getNodeId

      public NodeId getNodeId()
      Description copied from class: Node
      For error reporting.
      Specified by:
      getNodeId in class Node
      Returns:
      scalar, sequence, mapping
      See Also:
      "class variable 'id' in PyYAML"
    • getValue

      public java.util.List<NodeTuple> getValue()
      Returns the entries of this map.
      Specified by:
      getValue in class CollectionNode<NodeTuple>
      Returns:
      List of entries.
    • setValue

      public void setValue​(java.util.List<NodeTuple> mergedValue)
    • setOnlyKeyType

      public void setOnlyKeyType​(java.lang.Class<? extends java.lang.Object> keyType)
    • setTypes

      public void setTypes​(java.lang.Class<? extends java.lang.Object> keyType, java.lang.Class<? extends java.lang.Object> valueType)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • setMerged

      public void setMerged​(boolean merged)
      Parameters:
      merged - - true if map contains merge node
    • isMerged

      public boolean isMerged()
      Returns:
      true if map contains merge node