Package net.paulem.arcana.registry
Class WriteableRegistry<T extends RegistryKey<K>,K>
java.lang.Object
net.paulem.arcana.registry.AbstractRegistry<T,K>
net.paulem.arcana.registry.WriteableRegistry<T,K>
- Type Parameters:
T- the type
- All Implemented Interfaces:
Registry<T,K>
- Direct Known Subclasses:
NewFrozenRegistry
An Updatable registry that can have contents added arbitrarily.
- Since:
- 1.0.0-SNAPSHOT
-
Field Summary
Fields inherited from class net.paulem.arcana.registry.AbstractRegistry
registry -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class net.paulem.arcana.registry.AbstractRegistry
get, getOrDefault, getOrDefault, getOrNull, getOrThrow, keys
-
Constructor Details
-
WriteableRegistry
Creates a new, empty writeable registry backed by the map produced by the given supplier.- Parameters:
registrySupplier- supplies the backing map used to store registered objects
-
WriteableRegistry
public WriteableRegistry()Creates a new, empty writeable registry backed by aHashMap.
-
-
Method Details
-
register
Registers an object within the registry- Parameters:
object- the object to register- Returns:
- true if the value was successfully registered, otherwise false.
- Since:
- 1.0.0-SNAPSHOT
-