Mutable Default Bound Entry
class MutableDefaultBoundEntry<P : Any, C : Any>(container: MutablePersistentDataContainer, key: String, type: PersistentDataType<P, C>, defaultValue: () -> C) : DefaultBoundEntry<P, C> (source)
Represents a mutable default-bound entry in a MutablePersistentDataContainer.
This class extends DefaultBoundEntry and allows for modification of the value associated with the specified key. The entry is bound to a key and a type within the container and provides a default value if the key does not exist.
It provides operations to update the bound value in the container using either the setValue operator or the set method.
Author
Fantamomo
Since
3.2-SNAPSHOT
Parameters
P
The primitive data type.
C
The complex data type.
key
The key associated with the value in the container.
type
The type used to serialize/deserialize the value.
default Value
A lambda function that provides the default value if the key does not exist.
Constructors
Link copied to clipboard
constructor(container: MutablePersistentDataContainer, key: String, type: PersistentDataType<P, C>, defaultValue: () -> C)