Package org.spongepowered.api.registry
Interface RegistryKey<T>
-
- Type Parameters:
T
- The type
- All Known Subinterfaces:
DefaultedRegistryReference<T>
,RegistryReference<T>
public interface RegistryKey<T>
Similar toResourceKey
but with a defined type and id of the parent registry.The inclusion of the type assists with compile-time type verification checks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RegistryKey.Factory
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <V extends T>
DefaultedRegistryReference<V>asDefaultedReference(Supplier<RegistryHolder> defaultHolder)
Generates a utilityreference
used to assist in querying a value from this keyRegistryReference<T>
asReference()
Generates a utilityreference
used to assist in querying a value from this keyResourceKey
location()
Gets thekey
defining the id.static <T> RegistryKey<T>
of(RegistryType<T> registry, ResourceKey location)
RegistryType<T>
registry()
Gets thelocation
defining the parent registry.
-
-
-
Method Detail
-
of
static <T> RegistryKey<T> of(RegistryType<T> registry, ResourceKey location)
-
registry
RegistryType<T> registry()
Gets thelocation
defining the parent registry.- Returns:
- The location
-
location
ResourceKey location()
Gets thekey
defining the id. See the documentation on resource key for more information on the composition of this key.- Returns:
- The key
-
asReference
RegistryReference<T> asReference()
Generates a utilityreference
used to assist in querying a value from this key- Returns:
- The reference
-
asDefaultedReference
<V extends T> DefaultedRegistryReference<V> asDefaultedReference(Supplier<RegistryHolder> defaultHolder)
Generates a utilityreference
used to assist in querying a value from this key- Returns:
- The reference
-
-