The transformation function for this command.
The transformation function for this command.
Any value returned by this function must be assumed to be valid
at the command execution site. This must also include null
.
Any exceptional case must be indicated by throwing a Throwable.
the input
a new transformed data structure. May be null
.
Throwable
if any exceptional case occurs
Immutability of the data structure cannot be enforced. Therefore ensuring immutability (or at least apparent immutability) lies in the responsibility of the user.
The name of this command.
The name of this command.
This is targeted at UI applications where multi-path redo is possible. In such a situation the names of the commands can be useful to distinguish different redo paths.
the name of this command.
Chains this command with second one.
Chains this command with second one.
the output type of the second command
the command to chain with this one. May not be null
.
a MutationCommand with the functionality of this one
chained with g
.
NullPointerException
if g
is null
(mutationCommand: (T) ⇒ U).andThen(g)
(mutationCommand: (T) ⇒ U).apply(v1)
(mutationCommand: (T) ⇒ U).toString()
A mutation command represents a function transforming a given (immutable) data structure into another (immutable) data structure. Any mutation may result in any arbitrary exception or error. Therefore error handling is necessary at the command execution site.
the input type
the output type
1.3 (0.2.0), 2016-03-01
MCDDPUI 0.1.0
The implicit conversion methods function2mutationCommand and mutationCommand2function can be used to convert freely between types
,T => Unit
andReadCommand[T]
.Immutability of the data structure cannot be enforced. Therefore ensuring immutability (or at least apparent immutability) lies in the responsibility of the user.