Class MutableTreeRevision
java.lang.Object
com.vaadin.flow.signals.shared.impl.TreeRevision
com.vaadin.flow.signals.shared.impl.MutableTreeRevision
- All Implemented Interfaces:
Serializable
A tree revision that can be mutated by applying signal commands.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new mutable tree revision as a copy of the provided base revision. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(SignalCommand command, @Nullable SerializableBiConsumer<Id, CommandResult> resultCollector) Applies a single command and passes the results to the provided handler.voidapply(List<SignalCommand> commands) Applies a sequence of commands and ignores the results.applyAndGetResults(List<SignalCommand> commands) Applies a sequence of commands and collects the results to a map.Methods inherited from class com.vaadin.flow.signals.shared.impl.TreeRevision
assertValidTree, data, nodes, originalInserts, ownerId
-
Constructor Details
-
Method Details
-
applyAndGetResults
Applies a sequence of commands and collects the results to a map.- Parameters:
commands- the list of commands to apply, notnull- Returns:
- a map from command id to operation results, not
null
-
apply
Applies a sequence of commands and ignores the results.- Parameters:
commands- the list of commands to apply, notnull
-
apply
public void apply(SignalCommand command, @Nullable SerializableBiConsumer<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, notnullresultCollector- callback to collect command results, ornullto ignore results
-