Package xyz.jpenilla.squaremap.api
Interface Registry<T>
- Type Parameters:
T- Generic type argument
public interface Registry<T>
Simple registry interface
-
Method Summary
Modifier and TypeMethodDescriptionentries()Get the registered entriesGet the registered value for a keybooleanCheck whether an entry is present for the provided keyvoidRegister a new entry with the provided key and valuevoidunregister(@NonNull Key key) Unregister the entry for the provided key if present
-
Method Details
-
register
Register a new entry with the provided key and value- Parameters:
key- keyvalue- value- Throws:
IllegalArgumentException- when there is already an entry for the provided key
-
unregister
Unregister the entry for the provided key if present- Parameters:
key- key- Throws:
IllegalArgumentException- when there is no entry for the provided key
-
hasEntry
Check whether an entry is present for the provided key- Parameters:
key- key- Returns:
- whether an entry is present
-
get
Get the registered value for a key- Parameters:
key- key- Returns:
- value
- Throws:
IllegalArgumentException- when there is no value for the provided key
-
entries
Get the registered entries- Returns:
- the registered entries
-