Klasse RegistryRef<K,V>
java.lang.Object
de.luckymcdev.foundryengine.common.registry.RegistryRef<K,V>
- Typparameter:
K- Key Type.V- Value Type.
A Reference to an Entry in a
Registry / GenericRegistry.-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifikator und TypMethodeBeschreibungbooleanbooleanexists()Check if this entry exists in the registry.get()Get the value from the registry.getKey()Get the key this reference points to.inthashCode()voidExecute an action if the value exists.voidifPresentOrElse(Consumer<V> action, Runnable emptyAction) Execute an action if present, or a fallback if not.voidInvalidate the cache, forcing next get() to reload from registry.booleanisCached()Check if the value is cached (registry is frozen).<U> Optional<U> Map the value to another type.Get the value or a default if not present.Get the value or compute a default if not present.Get the value as an Optional.toString()
-
Konstruktordetails
-
RegistryRef
-
-
Methodendetails
-
get
Get the value from the registry. Caches the value if the registry is frozen.- Gibt zurück:
- the value, or null if not registered
-
orElse
-
orElseGet
-
toOptional
-
getKey
-
exists
public boolean exists()Check if this entry exists in the registry.- Gibt zurück:
- true if the key is registered
-
isCached
public boolean isCached()Check if the value is cached (registry is frozen).- Gibt zurück:
- true if value is cached
-
ifPresent
-
ifPresentOrElse
-
map
-
invalidateCache
public void invalidateCache()Invalidate the cache, forcing next get() to reload from registry. Useful for hot-reloading during development. -
equals
-
hashCode
-
toString
-