Package org.spongepowered.api.registry
Interface DefaultedRegistryReference<T>
-
- Type Parameters:
T
- The type
- All Superinterfaces:
RegistryKey<T>
,RegistryReference<T>
,Supplier<T>
public interface DefaultedRegistryReference<T> extends RegistryReference<T>, Supplier<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.registry.RegistryReference
RegistryReference.Factory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Supplier<RegistryHolder>
defaultHolder()
Optional<T>
find()
T
get()
Gets the value from the defaultholder
given when constructing this reference.-
Methods inherited from interface org.spongepowered.api.registry.RegistryKey
asDefaultedReference, asReference, location, registry
-
Methods inherited from interface org.spongepowered.api.registry.RegistryReference
find, get
-
-
-
-
Method Detail
-
get
T get()
Gets the value from the defaultholder
given when constructing this reference.Great care needs to be made in calling this method with any uncertainty as to if this reference will exist in the holder. Should this reference lack a value, a
ValueNotFoundException
will be thrown. Therefore, it is advised to callRegistryReference.find(RegistryHolder...)
instead.
-
defaultHolder
Supplier<RegistryHolder> defaultHolder()
-
-