to Immutable
Converts the current PersistentDataContainer instance to an immutable implementation.
This method creates a specialized immutable representation of the container, depending on its size and structure:
Returns
EmptyPersistentDataContainerif the container is empty.Creates a
SingletonPersistentDataContainerif the container contains exactly one key-value pair.Constructs a
PersistentDataContainerImplfor containers with more than one key-value pair.
Note: This operation ensures the resulting container is immutable, preventing further modifications.
Return
A PersistentDataContainer representing the immutable version of this container. The type of the returned instance depends on the size of the original container.
Author
Fantamomo
Since
1.0-SNAPSHOT