OwnedRegistry

A type-safe associative array with an associated owner type.

Extends Registry to add an owner type parameter Owner, enabling type-safe distinction between registries intended for different owners or contexts.

Type Parameters

Owner

The type representing the owner or context of this registry.

Inheritors

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Returns an iterable of all key-value pairs registered in this registry.

Link copied to clipboard
abstract operator fun contains(registryKey: RegistryKey<*>): Boolean

Checks if the registryKey is stored in the registry and has an association with a value.

Link copied to clipboard
abstract operator fun <T> get(registryKey: RegistryKey<out T>): T

Retrieves the value associated with the specified registryKey.

Link copied to clipboard
fun <T> Registry.getMaybe(registryKey: RegistryKey<T>): Maybe<T>

Retrieves value wrapped in Some by the specified registryKey or returns None if no association is present.

Link copied to clipboard
fun <T> Registry.getOrDefault(registryKey: RegistryKey<T>, default: T): T

Retrieves value by the specified registryKey or returns the default value if no association is present.

Link copied to clipboard
inline fun <T> Registry.getOrElse(registryKey: RegistryKey<out T>, block: () -> T): T

Retrieves value by the specified registryKey or computes the block and returns its value if no association is present.

Link copied to clipboard
fun <T> Registry.getOrNull(registryKey: RegistryKey<T>): T?

Retrieves value by the specified registryKey or returns null if no association is present.