MutableBufferedPersistentDataContainer

A mutable version of BufferedPersistentDataContainer that allows for flushing and refreshing the data.

This interface extends BufferedPersistentDataContainer and MutablePersistentDataContainer.

It provides methods to flush the buffered data to the underlying storage and refresh the buffered data from the underlying storage.

Author

Fantamomo

Since

1.0-SNAPSHOT

Inheritors

Properties

Link copied to clipboard
abstract override val size: Int

Functions

Link copied to clipboard
abstract override fun add(element: String): Boolean
Link copied to clipboard
abstract override fun addAll(elements: Collection<String>): Boolean
Link copied to clipboard
@JvmName(name = "create")
fun <P : Any, C : Any> PersistentDataContainer.bound(key: String, type: PersistentDataType<P, C>): BoundEntry<P, C>

Creates a bound entry for accessing persistent data within the container.

@JvmName(name = "create")
fun <P : Any, C : Any> PersistentDataContainer.bound(key: String, type: PersistentDataType<P, C>, default: () -> C): DefaultBoundEntry<P, C>

Creates a DefaultBoundEntry that is bound to the specified PersistentDataContainer. This entry allows the retrieval of a value using the specified key and type, with the capability to provide a default value if the key does not exist in the container.

Link copied to clipboard
inline fun MutablePersistentDataContainer.bulk(replace: Boolean = true, removeEntries: Boolean = replace, action: MutablePersistentDataContainer.() -> Unit)

This methode is used to make a bulk operation on the MutablePersistentDataContainer.

Link copied to clipboard
abstract override fun clear()

Clears all values from this container.

Link copied to clipboard
abstract fun clearBuffer()

Clears the buffer.

Link copied to clipboard
abstract fun <P : Any, C : Any> contains(key: String, type: PersistentDataType<P, C>): Boolean

Checks if the container contains a value associated with the specified key.

abstract operator override fun contains(element: String): Boolean
Link copied to clipboard

Checks if the container contains a value associated with the specified PersistentKey.

Link copied to clipboard
abstract override fun containsAll(elements: Collection<String>): Boolean
Link copied to clipboard

This methode copies all key-value pairs from the PersistentDataContainer to the receiver.

Link copied to clipboard
abstract fun deleteBuffer(key: String)

Deletes the buffer with the given key.

Link copied to clipboard
abstract fun flush()

Flushes the buffered data to the underlying storage.

Link copied to clipboard
abstract operator fun <P : Any, C : Any> get(key: String, type: PersistentDataType<P, C>): C?

Gets the value associated with the specified key.

Link copied to clipboard
operator fun <P : Any, C : Any> PersistentDataContainer.get(key: PersistentKey<P, C>): C?

Retrieves the value associated with the specified key from the persistent data container.

Link copied to clipboard

This methode is used to get the direct value of the key.

Link copied to clipboard

This method is used to get the value of the specified key from the PersistentDataContainer.

Link copied to clipboard
fun <P : Any, C : Any> PersistentDataContainer.getOrDefault(key: String, type: PersistentDataType<P, C>, default: C): C
fun <P : Any, C : Any> PersistentDataContainer.getOrDefault(key: String, type: PersistentDataType<P, C>, default: () -> C): C

This method is used to get the value of the specified key from the PersistentDataContainer.

Link copied to clipboard

This methode is uses to get the element by the key.

Link copied to clipboard
abstract fun <P : Any, C : Any> getPrimitive(key: String, type: PersistentDataType<P, C>): P?

Gets the primitive value associated with the specified key.

Link copied to clipboard
fun <P : Any, C : Any, T : PersistentDataType<P, C>, DefaultPersistentDataType<C>> PersistentDataContainer.getWithDefault(key: String, type: T, default: C = type.defaultValue): C

This method is used to get the value of the specified key from the PersistentDataContainer.

Link copied to clipboard
abstract override fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): Iterator<String>
Link copied to clipboard
abstract fun loadFrom(input: InputStream, serializer: SerializerStrategy = SerializerStrategy)

Loads data from the specified input stream using the specified serializer strategy.

Link copied to clipboard

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

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

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

Link copied to clipboard
fun <P : Any, C : Any> MutablePersistentDataContainer.putAll(type: PersistentDataType<P, C>, vararg entries: Pair<String, C>)

Adds multiple entries to this container using vararg pairs.

Adds all entries from the provided map to this container.

Link copied to clipboard

Adds multiple nullable entries to this container.

Link copied to clipboard
abstract fun refresh()

Refreshes the buffered data from the underlying storage.

Link copied to clipboard
abstract override fun remove(key: String): Boolean

Removes the value associated with the specified key from this container.

Link copied to clipboard

This methode removes the value of the specified key from the PersistentDataContainer.

Removes the value associated with the specified key from this container.

Link copied to clipboard
abstract override fun removeAll(elements: Collection<String>): Boolean

Removes all values associated with the specified keys from this container.

Link copied to clipboard
abstract override fun retainAll(elements: Collection<String>): Boolean
Link copied to clipboard
abstract fun saveTo(output: OutputStream, serializer: SerializerStrategy = SerializerStrategy)

Saves the data in the container to the specified output stream.

Link copied to clipboard
abstract operator fun <P : Any, C : Any> set(key: String, type: PersistentDataType<P, C>, value: C)

Sets the value associated with the specified key in this container.

Link copied to clipboard
operator fun <P : Any, C : Any> MutablePersistentDataContainer.set(key: PersistentKey<P, C>, value: C)

Sets the value associated with the specified persistent key in this container.

Link copied to clipboard

This method is used to set the value of the specified key in the PersistentDataContainer.

Link copied to clipboard
Link copied to clipboard

Converts the current PersistentDataContainer instance to an immutable implementation.

Link copied to clipboard

Converts this container's contents to a Map.

Link copied to clipboard

Attempts to retrieve a value from the persistent data container associated with the specified key and type, returning the result wrapped in a Result type.