mutableBound

Creates a new instance of MutableBoundEntry that is bound to the specified MutablePersistentDataContainer, using the provided key and PersistentDataType.

The returned MutableBoundEntry allows direct interaction with the container, enabling value modifications for the specified key and type.

Return

A MutableBoundEntry for managing the value associated with the given key and type.

Author

Fantamomo

Since

3.2-SNAPSHOT

Parameters

key

The unique identifier for the data entry within the container.

type

The type that defines how the data will be serialized and deserialized.


@JvmName(name = "createMutable")
fun <P : Any, C : Any> MutablePersistentDataContainer.mutableBound(key: String, type: PersistentDataType<P, C>, default: () -> C): MutableDefaultBoundEntry<P, C>(source)

Creates a mutable bound entry for a key in the given mutable persistent data container.

This function binds a key, its associated type, and a default value provider to a MutablePersistentDataContainer. The resulting MutableDefaultBoundEntry allows for both retrieval and modification of the associated value in the container, with fallback to a default value if the key does not exist.

Return

A MutableDefaultBoundEntry representing the binding of the key, type, and default value.

Author

Fantamomo

Since

3.2-SNAPSHOT

Parameters

key

The unique identifier associated with the value in the container.

type

The type used to serialize and deserialize the value.

default

A function that provides a default value when the key is not present in the container.