MetaContainer

@Serializable
data class MetaContainer(val map: Map<MetaContainer.Key<*>, Any>)(source)

A polymorphic container for storing heterogeneous key-value pairs with type-safe retrieval. Each key is bound to a specific type, enabling type-safe access to stored values.

Constructors

Link copied to clipboard
constructor(map: Map<MetaContainer.Key<*>, Any>)

Types

Link copied to clipboard
class Builder(map: MutableMap<MetaContainer.Key<*>, Any> = mutableMapOf<Key<*>, Any>())

Builder for constructing MetaContainer instances with a fluent API.

Link copied to clipboard
object Companion
Link copied to clipboard
interface Key<T : Any>

A marker interface for type-safe keys in MetaContainer.

Properties

Link copied to clipboard

The underlying map storing key-value pairs with polymorphic values.

Functions

Link copied to clipboard
operator fun <T : Any> contains(key: MetaContainer.Key<T>): Boolean

Checks whether a value exists for the given key.

Link copied to clipboard
operator fun <T : Any> get(key: MetaContainer.Key<T>): T?

Retrieves a value from the container by its key.