Class NodeValue<T extends Serializable>

    • Constructor Detail

      • NodeValue

        public NodeValue​(StateNode node)
        Creates a new feature for the given node.
        Parameters:
        node - the node which supports the feature
    • Method Detail

      • getKey

        protected abstract String getKey()
        Gets the key that should be used when the value of this feature is sent to the client.

        The key is fetched on demand from the sub class instead of e.g. requiring it as a constructor parameter to avoid storing an additional member field in each instance.

        Returns:
        the key value, not null
      • setValue

        protected void setValue​(T value)
        Sets the value of this feature.
        Parameters:
        value - the value to set
      • getValue

        protected T getValue()
        Gets the value of this feature.
        Returns:
        the previously set value
      • collectChanges

        public void collectChanges​(Consumer<NodeChange> collector)
        Description copied from class: NodeFeature
        Collects all changes that are recorded for this feature.
        Specified by:
        collectChanges in class NodeFeature
        Parameters:
        collector - a consumer accepting node changes
      • generateChangesFromEmpty

        public void generateChangesFromEmpty()
        Description copied from class: NodeFeature
        Generates all changes that would be needed to take this node from its initial empty state to its current state.
        Specified by:
        generateChangesFromEmpty in class NodeFeature
      • forEachChild

        public void forEachChild​(Consumer<StateNode> action)
        Description copied from class: NodeFeature
        Passes each child node instance to the given consumer.
        Specified by:
        forEachChild in class NodeFeature
        Parameters:
        action - the consumer that accepts each child