Registry

@CataloguedBy(catalogue = Registries::class)
interface Registry<T> : Iterable<T>

A holder for registry entries.

Parameters

T

the registry entry type

Inheritors

Functions

Link copied to clipboard
abstract fun containsKey(key: Key): Boolean
abstract fun containsKey(key: ResourceKey<T>): Boolean

Checks if the given key has a registered value in this registry.

Link copied to clipboard
abstract fun entries(): Set<Map.Entry<ResourceKey<T>, T>>

Gets the set of entries registered in this registry.

Link copied to clipboard
open fun forEach(p0: Consumer<in T>)
Link copied to clipboard
abstract fun get(key: Key): T?

Gets a value by its namespaced key, or null if there is no value associated with the given key.

abstract fun get(key: ResourceKey<T>): T?

Gets a value by its resource key, or null if there is no value associated with the given key.

Link copied to clipboard
abstract fun getKey(value: T): Key?

Gets a namespaced Key by its value, or null if there is no key associated with the given value.

Link copied to clipboard
abstract fun getResourceKey(value: T): ResourceKey<T>?

Gets the ResourceKey for the given value, or null if there is no key associated with the given value.

Link copied to clipboard
abstract fun getTagValues(key: TagKey<T>): TagSet<T>?

Gets the tag values for the given key, or returns null if there are no tag values associated with the given key.

Link copied to clipboard
abstract operator fun iterator(): Iterator<T>
Link copied to clipboard
abstract fun keys(): Set<Key>

Gets the set of keys registered in this registry.

Link copied to clipboard
abstract fun registryKeys(): Set<ResourceKey<T>>

Gets the set of registry keys registered in this registry.

Link copied to clipboard
abstract fun size(): Int

Gets the size of this registry, which is the number of registered elements.

Link copied to clipboard
Link copied to clipboard
abstract fun stream(): Stream<T>

Creates a new stream of the elements in this registry.

Link copied to clipboard
abstract fun tagKeys(): Set<TagKey<T>>

Gets the set of keys for all the registered tags in this registry.

Link copied to clipboard
abstract fun tags(): Collection<TagSet<T>>

Gets the set of keys for all the registered tags in this registry.

Properties

Link copied to clipboard
abstract val key: ResourceKey<out Registry<T>>

The registry key for this registry.