State
A state holds variables that can be configured, validated, copied, and loaded.
In a State, fields are typically mutable, because the user can change the field. However, fields that themselves also contain data (e.g. a Collection or a DecoratorScheme) should be stored as immutable references (but may themselves be mutable). For example, instead of having the field var list: List<String>
, a State should have the field val list: MutableList<String>
. This reflects the typical case in which the user does not change the reference to the object, but changes the properties inside the object. And, more importantly, means that nested a SchemeEditor can share a single unchanging reference to a State with its nested SchemeEditors.
Inheritors
Properties
Functions
Sets the State.context of this State to context.
Sets the State.context of this State to be a reference to context.
Returns a deep copy, retaining the uuid if and only if retainUuid is true
.
When invoked by the instance this
on (another) instance self
as self.deepCopyTransient()
, this method copies Transient fields from this
to self
, and returns self
.
Validates the state, and indicates whether and why it is invalid.