Interface Registry<T extends Nameable,V>
- Type Parameters:
T
- Type ofNameable
V
- Type of stored entries
- All Known Subinterfaces:
SchematicRegistry
,StorageRegistry
public interface Registry<T extends Nameable,V>
Interface which represents the base for a registry, which holds values associated with a
Nameable
key.-
Method Summary
Modifier and TypeMethodDescriptionReturns the value associated with this keyboolean
isRegistered
(T key) Checks if an entry with this key is registeredvoid
Registers an enty with this keyregistry()
Get a map of the registered entriesvoid
unregister
(T key) Unregisters any value associated with this key.
-
Method Details
-
register
Registers an enty with this key- Parameters:
key
- keyentry
- entry- Throws:
AlreadyRegisteredException
- When an entry with this key is already present.
-
unregister
Unregisters any value associated with this key.- Parameters:
key
- key
-
get
Returns the value associated with this key- Parameters:
key
- key- Returns:
- value
- Throws:
IllegalArgumentException
- if no entry is registered with this key.
-
isRegistered
Checks if an entry with this key is registered- Parameters:
key
- key- Returns:
- true if registered
-
registry
Get a map of the registered entries- Returns:
- unmodifiable map
-