com.vaadin.signals.impl.

Class MutableTreeRevision

java.lang.Object
com.vaadin.signals.impl.TreeRevision
com.vaadin.signals.impl.MutableTreeRevision
public class MutableTreeRevision extends TreeRevision

A tree revision that can be mutated by applying signal commands.

  • Constructor Details

    • MutableTreeRevision

      public MutableTreeRevision(TreeRevision base)

      Creates a new mutable tree revision as a copy of the provided base revision.

      Parameters:

      base - the base revision to copy, not null

  • Method Details

    • applyAndGetResults

      public Map<Id,CommandResult> applyAndGetResults(List<SignalCommand> commands)

      Applies a sequence of commands and collects the results to a map.

      Parameters:

      commands - the list of commands to apply, not null

      Returns:

      a map from command id to operation results, not null

    • apply

      public void apply(List<SignalCommand> commands)

      Applies a sequence of commands and ignores the results.

      Parameters:

      commands - the list of commands to apply, not null

    • apply

      public void apply(SignalCommand command, BiConsumer<Id,CommandResult> resultCollector)

      Applies a single command and passes the results to the provided handler. Note that the handler will be invoked exactly once for most types of commands but it will be invoked multiple times for transactions.

      Parameters:

      command - the command to apply, not null

      resultCollector - callback to collect command results, or null to ignore results