Class 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 Detail

      • 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 Detail

      • 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