T - The type of the registered objectspublic class Registry<T> extends Object
| Constructor and Description |
|---|
Registry() |
| Modifier and Type | Method and Description |
|---|---|
T |
byId(String id)
Gets the value of the given identifier.
|
Set<Map.Entry<String,T>> |
entries()
Gets an immutable-view of all entries (key + value)
registered into the registry.
|
void |
forEach(BiConsumer<String,T> consumer) |
Set<String> |
keys()
Gets an immutable-view of value keys registered into
the registry.
|
Registry<T> |
register(String id,
T value)
Registers the given value, with the given identifier.
|
Collection<T> |
values()
Gets an immutable-view of all values registered into
the registry.
|
public Registry<T> register(String id, T value)
id - The identifier of the valuevalue - The valuethis, for chainingpublic T byId(String id)
id - The identifier of the valuenull if not presentpublic Set<String> keys()
Map.keySet()public Collection<T> values()
Map.values()public Set<Map.Entry<String,T>> entries()
Map.entrySet()public void forEach(BiConsumer<String,T> consumer)
Map.forEach(BiConsumer)