Package org.geysermc.geyser.registry
Class MappedRegistry<K,V,M extends Map<K,V>>
java.lang.Object
org.geysermc.geyser.registry.Registry<M>
org.geysermc.geyser.registry.AbstractMappedRegistry<K,V,M>
org.geysermc.geyser.registry.MappedRegistry<K,V,M>
- Type Parameters:
K
- the keyV
- the valueM
- the map
An public registry holding a map of various registrations as defined by
MappedRegistry
.
The M represents the map class, which can be anything that extends Map
. The
MappedRegistry
and MappedRegistry
generics are the key and value respectively.-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
MappedRegistry(I input, RegistryLoader<I,M> registryLoader)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <I, K, V, M extends Map<K, V>>
MappedRegistry<K,V,M>create(I input, Supplier<RegistryLoader<I,M>> registryLoader)
Creates a new mapped registry with the givenRegistryLoader
and input.static <I, K, V, M extends Map<K, V>>
MappedRegistry<K,V,M>create(I input, RegistryLoader<I,M> registryLoader)
Creates a new mapped registry with the givenRegistryLoader
and input.static <I, K, V, M extends Map<K, V>>
MappedRegistry<K,V,M>create(Supplier<RegistryLoader<I,M>> registryLoader)
Creates a new mapped registry with the givenRegistryLoader
supplier.static <I, K, V, M extends Map<K, V>>
MappedRegistry<K,V,M>create(RegistryLoader<I,M> registryLoader)
Creates a new mapped registry with the givenRegistryLoader
.Methods inherited from class org.geysermc.geyser.registry.AbstractMappedRegistry
get, getOrDefault, map, register
-
Constructor Details
-
MappedRegistry
-
-
Method Details
-
create
public static <I, K, V, M extends Map<K, V>> MappedRegistry<K,V,M> create(RegistryLoader<I,M> registryLoader)Creates a new mapped registry with the givenRegistryLoader
. The input type is not specified here, meaning the loader return type is either predefined, or the registry is populated at a later point.- Type Parameters:
I
- the inputK
- the map keyV
- the map valueM
- the returned mappings type, a map in this case- Parameters:
registryLoader
- the registry loader- Returns:
- a new registry with the given RegistryLoader
-
create
public static <I, K, V, M extends Map<K, V>> MappedRegistry<K,V,M> create(I input, RegistryLoader<I,M> registryLoader)Creates a new mapped registry with the givenRegistryLoader
and input.- Type Parameters:
I
- the inputK
- the map keyV
- the map valueM
- the returned mappings type, a map in this case- Parameters:
input
- the inputregistryLoader
- the registry loader- Returns:
- a new registry with the given RegistryLoader
-
create
public static <I, K, V, M extends Map<K, V>> MappedRegistry<K,V,M> create(Supplier<RegistryLoader<I,M>> registryLoader)Creates a new mapped registry with the givenRegistryLoader
supplier. The input type is not specified here, meaning the loader return type is either predefined, or the registry is populated at a later point.- Type Parameters:
I
- the inputK
- the map keyV
- the map valueM
- the returned mappings type, a map in this case- Parameters:
registryLoader
- the registry loader supplier- Returns:
- a new registry with the given RegistryLoader supplier
-
create
public static <I, K, V, M extends Map<K, V>> MappedRegistry<K,V,M> create(I input, Supplier<RegistryLoader<I,M>> registryLoader)Creates a new mapped registry with the givenRegistryLoader
and input.- Type Parameters:
I
- the inputK
- the map keyV
- the map valueM
- the returned mappings type, a map in this case- Parameters:
registryLoader
- the registry loader- Returns:
- a new registry with the given RegistryLoader supplier
-