Interface Registry<T>
- All Known Implementing Classes:
SimpleRegistry
public interface Registry<T>
A read-only collection of values addressed by
TypedKey, such as the entity types.- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value registered under a key, or empty if there is none.Gets the value registered under a key.Gets the key a value is registered under.Returns the key identifying this registry.stream()Returns a stream over every registered value, in registration order.values()Returns every registered value, in registration order.
-
Method Details
-
registryKey
RegistryKey<T> registryKey()Returns the key identifying this registry.- Returns:
- the key identifying this registry
- Since:
- 0.1.0
-
get
Gets the value registered under a key.- Parameters:
key- the key- Returns:
- the value
- Throws:
NoSuchElementException- if nothing is registered under that key- Since:
- 0.1.0
-
find
-
key
Gets the key a value is registered under.- Parameters:
value- the value- Returns:
- its key
- Throws:
UnsupportedOperationException- if this registry cannot map values back to keys- Since:
- 0.1.0
-
values
Collection<T> values()Returns every registered value, in registration order.- Returns:
- every registered value, in registration order
- Since:
- 0.1.0
-
stream
-