MutableAttributes

Mutable type safe property bag

Inheritors

Inherited properties

Link copied to clipboard
abstract val isEmpty: Boolean

Flag indicating if attributes is empty

Link copied to clipboard

Flag indicating if attributes is not empty

Link copied to clipboard
abstract val keys: Set<AttributeKey<*>>

Get a set of all the keys

Functions

Link copied to clipboard
abstract fun <T : Any> computeIfAbsent(key: AttributeKey<T>, block: () -> T): T

Gets a value of the attribute for the specified key, or calls supplied block to compute its value

Link copied to clipboard
abstract fun <T : Any> remove(key: AttributeKey<T>)

Removes an attribute with the specified key

Link copied to clipboard
abstract operator fun <T : Any> set(key: AttributeKey<T>, value: T)

Creates or changes an attribute with the specified key using value

Inherited functions

Link copied to clipboard

Appends a value to a list-typed attribute. If the attribute does not exist, it will be created.

Link copied to clipboard
abstract operator fun contains(key: AttributeKey<*>): Boolean

Check if an attribute with the specified key exists

Link copied to clipboard
operator fun <T : Any> Attributes.get(key: AttributeKey<T>): T

Gets a value of the attribute for the specified key or throws an IllegalStateException if key does not exist

Link copied to clipboard
abstract fun <T : Any> getOrNull(key: AttributeKey<T>): T?

Get a value of the attribute for the specified key or null

Link copied to clipboard

Merge another attributes instance into this set of attributes favoring other

Link copied to clipboard

Set a value for key only if it is not already set

Link copied to clipboard

Set a value for key only if it is not already set and if value is not null.

Link copied to clipboard

Set a value for key only if value is not null

Link copied to clipboard

Removes an attribute with the specified key and returns its current value, throws an exception if an attribute doesn't exist

Link copied to clipboard

Removes an attribute with the specified key and returns its current value, returns null if an attribute doesn't exist

Link copied to clipboard

Returns a new MutableAttributes instance with elements from this set of attributes.