Interface Registry<T extends Nameable,V>
- Type Parameters:
T- Type ofNameableV- 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 keybooleanisRegistered(T key) Checks if an entry with this key is registeredvoidRegisters an enty with this keyregistry()Get a map of the registered entriesvoidunregister(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
-