AbstractPropertyStore

Base implementation of PropertyStore that provides common functionality.

This class implements default behaviors for a property store, allowing specific implementations to focus on the storage mechanism itself.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract suspend fun clear()

Removes all properties from the store.

Link copied to clipboard
abstract suspend operator fun contains(propertyId: String): Boolean

Checks if a property with the given id exists in the store.

Link copied to clipboard
suspend fun PropertyStore.count(): Int

Returns the number of properties in the store.

Link copied to clipboard
abstract suspend override fun <T> createOrUpdate(property: Property<T>)

Creates a new property or updates an existing one atomically.

Link copied to clipboard
suspend fun <T> PropertyStore.createOrUpdateProperty(property: Property<T>)

Creates a new property or updates it if it already exists (upsert operation).

Link copied to clipboard
abstract suspend operator fun <T> get(propertyId: String): Property<T>?

Retrieves a property by id.

Link copied to clipboard
abstract suspend fun getAll(): Map<String, Property<*>>

Retrieves all properties in the store.

Link copied to clipboard
abstract suspend fun <T> getOrDefault(propertyId: String, defaultValue: Property<T>): Property<T>

Retrieves a property by id, or returns a default if not found.

Link copied to clipboard

Retrieves a property by name, throwing an exception if not found.

Link copied to clipboard
suspend fun <T> PropertyStore.getPropertyValue(name: String): T?

Retrieves a property's value directly, without the Property wrapper.

Link copied to clipboard
suspend fun <T> PropertyStore.getPropertyValueOrDefault(name: String, default: T): T

Retrieves a property's value, or returns a default if not found.

Link copied to clipboard
abstract suspend fun isEmpty(): Boolean

Checks whether the store is empty.

Link copied to clipboard
abstract suspend fun listPropertyIds(): Set<String>

Lists all property ids in the store.

Link copied to clipboard
abstract suspend operator fun minusAssign(propertyId: String)

Removes a property from the store by id.

Link copied to clipboard
abstract suspend operator fun <T> plusAssign(property: Property<T>)

Adds a new property to the store.

Link copied to clipboard
abstract suspend fun <T> updateProperty(property: Property<T>)

Updates an existing property in the store.

abstract suspend fun <T> updateProperty(name: String, transform: (Property<T>) -> Property<T>)

Atomically updates a property using a transformation function.