com.vaadin.signals.impl.
Interface CommandResult
All Known Implementing Classes:
The result of applying a signal command against a tree revision. The result is either to accept or reject the command.
See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
An accepted command.
static final record
A data node update in an accepted command result.
static final record
A rejected command, together with the reason for the rejection.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accepted()
Tests whether this command result is accepted or rejected.
static CommandResult
conditional
(boolean condition, String reasonIfFailed) Creates an accepted or rejected result depending on the provided condition.
static CommandResult.Reject
Creates a new rejected result with the given reason.
static CommandResult.Accept
ok()
Creates a simple accepted result without modifications or original inserts.
static Map<Id,
CommandResult> rejectAll
(Map<Id, CommandResult> results, String reason) Creates a copy of the given map of command results where all accepted results are replaced with the same rejection.
-
Method Details
-
accepted
boolean accepted()Tests whether this command result is accepted or rejected.
Returns:
true
if the command is accepted,false
if it's rejected -
rejectAll
Creates a copy of the given map of command results where all accepted results are replaced with the same rejection.
Parameters:
results
- the original map from ids to command results, notnull
reason
- the rejection reason string, notnull
Returns:
a map with all accepted results replaced with rejections
-
ok
Creates a simple accepted result without modifications or original inserts.
Returns:
the accepted result, not
null
-
fail
Creates a new rejected result with the given reason.
Parameters:
reason
- the reason string to use, notnull
Returns:
a new rejected result, not
null
-
conditional
Creates an accepted or rejected result depending on the provided condition.
Parameters:
condition
- the condition to checkreasonIfFailed
- the reason string to use if rejected, notnull
Returns:
an accepted result if the condition is
true
, a rejected result if the condition isfalse
-