RegistryEntry

sealed interface RegistryEntry<out T : Keyed> : Provider<T>

Represents a key-value pair in a registry.

Two registry entries are considered equal == iff their registries and keys match.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface Nova<out T : NovaRegistryElement<T>> : RegistryEntry<T>

Represents a key-value pair in a Nova registry.

Link copied to clipboard
sealed interface Paper<out T : Keyed> : RegistryEntry<T>

Represents a key-value pair in a Paper registry.

Properties

Link copied to clipboard
abstract val children: Set<Provider<*>>
Link copied to clipboard
open val delegate: Provider<T>
Link copied to clipboard
abstract val isStable: Boolean
Link copied to clipboard
abstract val key: Key

The key of the registry entry.

Link copied to clipboard
abstract val parents: Set<Provider<*>>
Link copied to clipboard
abstract val value: DeferredValue<T>

Functions

Link copied to clipboard
abstract fun addStrongChild(child: Provider<*>)
Link copied to clipboard
abstract fun addWeakChild(child: Provider<*>)
Link copied to clipboard
fun <T, R> Provider<T>.bootstrapFlatMap(transform: (T) -> Provider<R>): Provider<R>

Flat-maps the value of this provider via transform. During bootstrap phase, uses Provider.flatMap, otherwise Provider.immediateFlatMap. This allows creating flat-mapped providers based off of RegistryEntries lazily during bootstrap phase, where resolving their value is not possible, without paying for the extra overhead post-bootstrap, where immediateFlatMap can be used.

Link copied to clipboard
fun <T> Provider<Provider<T>>.bootstrapFlatten(): Provider<T>

Flattens the value of this provider. During bootstrap phase, uses Provider.flatMap, otherwise Provider.immediateFlatMap. This allows creating flat-mapped providers based off of RegistryEntries lazily during bootstrap phase, where resolving their value is not possible, without paying for the extra overhead post-bootstrap, where immediateFlatMap can be used.

Link copied to clipboard
abstract fun <R> flatMap(transform: (T) -> Provider<R>): Provider<R>
Link copied to clipboard
open override fun get(): T
Link copied to clipboard
open operator fun <X> getValue(thisRef: X?, property: KProperty<*>?): T
Link copied to clipboard
abstract fun handleParentUpdated(updatedParent: Provider<*>)
Link copied to clipboard
abstract fun <R> immediateFlatMap(transform: (T) -> Provider<R>): Provider<R>
Link copied to clipboard
abstract fun <R> immediateFlatMapMutable(transform: (T) -> MutableProvider<R>): MutableProvider<R>
Link copied to clipboard
abstract fun <R> map(transform: (T) -> R): Provider<R>
Link copied to clipboard
abstract fun observe(action: () -> Unit)
Link copied to clipboard
abstract fun <R : Any> observeWeak(owner: R, action: (owner: R) -> Unit)
Link copied to clipboard
abstract fun removeStrongChild(child: Provider<*>)
Link copied to clipboard
abstract fun removeWeakChild(child: Provider<*>)
Link copied to clipboard
abstract fun <R> strongFlatMap(transform: (T) -> Provider<R>): Provider<R>
Link copied to clipboard
abstract fun <R> strongImmediateFlatMap(transform: (T) -> Provider<R>): Provider<R>
Link copied to clipboard
abstract fun <R> strongImmediateFlatMapMutable(transform: (T) -> MutableProvider<R>): MutableProvider<R>
Link copied to clipboard
abstract fun <R> strongMap(transform: (T) -> R): Provider<R>
Link copied to clipboard
abstract fun subscribe(action: (value: T) -> Unit)
Link copied to clipboard
abstract fun <R : Any> subscribeWeak(owner: R, action: (owner: R, value: T) -> Unit)
Link copied to clipboard
abstract fun unobserve(action: () -> Unit)
Link copied to clipboard
abstract fun <R : Any> unobserveWeak(owner: R)
abstract fun <R : Any> unobserveWeak(owner: R, action: (R) -> Unit)
Link copied to clipboard
abstract fun unsubscribe(action: (T) -> Unit)
Link copied to clipboard
abstract fun <R : Any> unsubscribeWeak(owner: R)
abstract fun <R : Any> unsubscribeWeak(owner: R, action: (R, T) -> Unit)