interface Attributes
Map of attributes accessible by AttributeKey in a typed manner
abstract val allKeys: List<AttributeKey<*>>
Returns List of all AttributeKey instances in this map |
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 |
|
abstract operator fun contains(key: AttributeKey<*>): Boolean
Checks if an attribute with the specified key exists |
|
open operator fun <T : Any> get(key: AttributeKey<T>): T
Gets a value of the attribute for the specified key, or throws an exception if an attribute doesn't exist |
|
abstract fun <T : Any> getOrNull(key: AttributeKey<T>): T?
Gets a value of the attribute for the specified key, or return |
|
abstract fun <T : Any> put(key: AttributeKey<T>, value: T): Unit
Creates or changes an attribute with the specified key using value |
|
abstract fun <T : Any> remove(key: AttributeKey<T>): Unit
Removes an attribute with the specified key |
|
open fun <T : Any> take(key: AttributeKey<T>): T
Removes an attribute with the specified key and returns its current value, throws an exception if an attribute doesn't exist |
|
open fun <T : Any> takeOrNull(key: AttributeKey<T>): T?
Removes an attribute with the specified key and returns its current value, returns |