public interface MutableState extends State
State interface extension for mutable states whose values can be directly modified. Requires implementing
the method set(Object, Object) so variable values for the input key can be set. If the State State.copy()
method performs shallow copies, and the variable is a non-primitive data field,
then the set(Object, Object) method should perform a safe copy-on-write operation so that the State
object from which the state was copied is not modified.| Modifier and Type | Method and Description |
|---|---|
MutableState |
set(java.lang.Object variableKey,
java.lang.Object value)
Sets the value for the given variable key.
|
copy, get, variableKeysMutableState set(java.lang.Object variableKey, java.lang.Object value)
variableKey - the key identifier for the variable value to changevalue - the variable value to which the variable should be set.