Package-level declarations

Types

Link copied to clipboard
data class AttributeKey<T>(val name: String)

Specifies a key for an attribute

Link copied to clipboard
interface Attributes

Immutable type safe property bag

Link copied to clipboard
Link copied to clipboard
interface ExpiringKeyedCache<K, V>

A multi-value cache which supports retrieval and invalidation via a key paired with each value. The get and invalidate methods are suspend functions to allow for cross-context synchronization and potentially-expensive value lookup.

Link copied to clipboard
interface MultiMap<K, V> : Map<K, List<V>>

A collection similar to a Map except it allows multiple values to be associated with a single key. The associated values are not necessarily distinct (e.g., key foo may be associated with value bar multiple times).

Link copied to clipboard

Mutable type safe property bag

Link copied to clipboard

A mutable collection similar to a MutableMap except it allows multiple values to be associated with a single key. The associated values are not necessarily distinct (e.g., key foo may be associated with value bar multiple times).

Link copied to clipboard
interface ValuesMap<T>

Mapping of String to a List of T values

Inherited properties

Link copied to clipboard

Flag indicating if attributes is not empty

Functions

Link copied to clipboard
inline fun attributesOf(block: AttributesBuilder.() -> Unit): Attributes

Return a new set of attributes using AttributesBuilder.

Link copied to clipboard
fun <T> createOrAppend(dest: List<T>?, x: T): List<T>

Creates a new list or appends to an existing one if not null.

Link copied to clipboard

Returns an empty read-only set of attributes

Link copied to clipboard
fun <K, V> multiMapOf(vararg pairs: <Error class: unknown class><K, V>): MultiMap<K, V>

Create a new MultiMap from the given key-value pairs

Link copied to clipboard

Returns an empty new mutable set of attributes

Link copied to clipboard

Return a new set of mutable attributes using AttributesBuilder.

Link copied to clipboard
fun <K, V> mutableMultiMapOf(vararg pairs: <Error class: unknown class><K, V>): MutableMultiMap<K, V>

Create a new MutableMultiMap from the given key-value pairs.

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
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

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.