Class NodeFeature

java.lang.Object
com.vaadin.client.flow.nodefeature.NodeFeature
Direct Known Subclasses:
NodeList, NodeMap

public abstract class NodeFeature extends Object
Holder of the actual data in a state node. The state node data is isolated into different features of related data.
Since:
1.0
Author:
Vaadin Ltd
  • Constructor Summary

    Constructors
    Constructor
    Description
    NodeFeature(int id, StateNode node)
    Creates a new feature.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract elemental.json.JsonValue
    convert(Function<Object,elemental.json.JsonValue> converter)
    Convert the feature values into a JsonValue using provided converter for the values stored in the feature (i.e. primitive types, StateNodes).
    protected elemental.json.JsonValue
    Helper for getting a JSON representation of a child value.
    abstract elemental.json.JsonValue
    Gets a JSON object representing the contents of this feature.
    int
    Gets the id of this feature.
    Gets the node of this feature.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NodeFeature

      public NodeFeature(int id, StateNode node)
      Creates a new feature.
      Parameters:
      id - the id of the feature
      node - the node that the feature belongs to
  • Method Details

    • getId

      public int getId()
      Gets the id of this feature.
      Returns:
      the id
    • getNode

      public StateNode getNode()
      Gets the node of this feature.
      Returns:
      the node
    • getDebugJson

      public abstract elemental.json.JsonValue getDebugJson()
      Gets a JSON object representing the contents of this feature. Only intended for debugging purposes.
      Returns:
      a JSON representation
    • convert

      public abstract elemental.json.JsonValue convert(Function<Object,elemental.json.JsonValue> converter)
      Convert the feature values into a JsonValue using provided converter for the values stored in the feature (i.e. primitive types, StateNodes).
      Parameters:
      converter - converter to convert values stored in the feature
      Returns:
      resulting converted value
    • getAsDebugJson

      protected elemental.json.JsonValue getAsDebugJson(Object value)
      Helper for getting a JSON representation of a child value.
      Parameters:
      value - the child value
      Returns:
      the JSON representation