com.vaadin.signals.

Class NodeSignal.NodeSignalState

java.lang.Object
com.vaadin.signals.NodeSignal.NodeSignalState

Enclosing class:

NodeSignal

public static class NodeSignal.NodeSignalState extends Object

The snapshot of the state of a node signal. Gives access to the value and child nodes.

  • Constructor Details

    • NodeSignalState

      public NodeSignalState(com.fasterxml.jackson.databind.JsonNode value, NodeSignal parent, List<NodeSignal> listChildren, Map<String,NodeSignal> mapChildren)

      Creates a new state snapshot based on the given JSON value, list children and map children.

      Parameters:

      value - the JSON value, or null if there is no value

      parent - the parent node, nor null for the value of the root node

      listChildren - a list of children accessed by order, or an empty list if there are no list children. Not null.

      mapChildren - a map of children access by key, or an empty map if there are no map children. Not null.

  • Method Details

    • value

      public <T> T value(Class<T> valueType)

      Gets the value as the given type.

      Type Parameters:

      T - the value type

      Parameters:

      valueType - the value type, not null

      Returns:

      the value, or null if there is no value

    • parent

      public NodeSignal parent()

      Gets the parent node of this signal.

      Returns:

      the parent node, or null for the root node

    • listChildren

      public List<NodeSignal> listChildren()

      Gets a list with the children accessed by order.

      Returns:

      a list of children, not null

    • mapChildren

      public Map<String,NodeSignal> mapChildren()

      Gets a map of the children accessed by key.

      Returns:

      a map of children, not null