Class TreeChangeProcessor


  • public class TreeChangeProcessor
    extends Object
    Updates a state tree based on changes in JSON format.
    Since:
    1.0
    Author:
    Vaadin Ltd
    • Method Detail

      • processChanges

        public static JsSet<StateNode> processChanges​(StateTree tree,
                                                      elemental.json.JsonArray changes)
        Update a state tree based on a JSON array of changes.
        Parameters:
        tree - the tree to update
        changes - the JSON array of changes
        Returns:
        a set of updated nodes addressed by the changes
      • processChange

        public static StateNode processChange​(StateTree tree,
                                              elemental.json.JsonObject change)
        Update a state tree based on a JSON change. This method is public for testing purposes.
        Parameters:
        tree - the tree to update
        change - the JSON change
        Returns:
        the updated node addressed by the provided change