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.
|
Registry<T> |
register(String id,
T value)
Registers the given value, with the given identifier.
|
Collection<T> |
values()
Gets all of the values within 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 valuepublic Collection<T> values()