Class DataTree.Immut
- Enclosing class:
DataTree
This type guarantees that all of its entries are immutable (deep immutability). That is, DataTrees and
DataLists contained within this tree's entries will always be immutable.
-
Nested Class Summary
Nested classes/interfaces inherited from class space.arim.dazzleconf.backend.DataTree
DataTree.Immut, DataTree.Mut -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforEach(BiConsumer<? super @NonNull Object, ? super @NonNull DataEntry> action) Runs an action for each key/value pair.@Nullable DataEntryGets the entry at the specified key, or null if unset.@NonNull DataTree.ImmutGets this data tree as an immutable one.@NonNull DataTree.MutintoMut()Gets this data tree as a mutable one.
-
Constructor Details
-
Immut
public Immut()Creates an empty data tree
-
-
Method Details
-
get
Description copied from class:DataTreeGets the entry at the specified key, or null if unset.If accessing keys based on method names, it is strongly recommended to use the
KeyMapperto map method names to keys. The key mapper is available during both deserialization and serialization. -
forEach
Description copied from class:DataTreeRuns an action for each key/value pair.Iteration maintains the order with which this data tree was created.
-
intoImmut
Description copied from class:DataTreeGets this data tree as an immutable one.The data contained within this
DataTreeis moved to an immutable instance. The old instance may still be used, but the implementation of this method may be optimized for the case that it is not.If this instance is already
DataTree.Immut, then it may be returned without changes. -
intoMut
Description copied from class:DataTreeGets this data tree as a mutable one.If not mutable, the data is copied to a new tree, which will be made deeply mutable. That is, this function will also be called on any
DataTrees encountered in this tree's entries, andDataList.intoMut()on any data lists likewise.If this instance is already
DataTree.Mut, then it may be returned without changes.
-