Class MappingNode


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

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

  • Field Details

  • Constructor Details

    • MappingNode

      public MappingNode(Tag tag, boolean resolved, List<NodeTuple> value, FlowStyle flowStyle, Optional<Mark> startMark, Optional<Mark> endMark)
      Create
      Parameters:
      tag - - tag of the node
      resolved - - true when the tag is implicitly resolved
      value - - the value
      flowStyle - - the flow style of the node
      startMark - - start
      endMark - - end
    • MappingNode

      public MappingNode(Tag tag, List<NodeTuple> value, FlowStyle flowStyle)
      Create
      Parameters:
      tag - - tag of the node
      value - - the value
      flowStyle - - the flow style of the node
  • Method Details

    • getNodeType

      public NodeType getNodeType()
      Specified by:
      getNodeType in class Node
      Returns:
      scalar, sequence, mapping
    • getValue

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

      public void setValue(List<NodeTuple> merged)
      Applications may need to replace the content (Spring Boot). Merging was removed, but it may be implemented.
      Parameters:
      merged - - merged data to replace the internal value
    • toString

      public String toString()
      Overrides:
      toString in class Object