| Modifier and Type | Method and Description |
|---|---|
<T> void |
register(Class<T> type,
T object)
Register the given object under the given type.
|
void |
register(Object object)
Registers the given object with its concrete type.
|
<T> void |
registerLazy(Class<T> type,
Factory<? extends T> factory)
Registers a lazily created entry to the registry.
|
<T> void |
remove(Class<T> type)
Remove the registration for the given type.
|
<T> void register(Class<T> type, T object)
T - The public type of the objecttype - The public type of the objectobject - The object to add to the registryvoid register(Object object)
object - The object to register<T> void registerLazy(Class<T> type, Factory<? extends T> factory)
The factory will be invoked exactly once, when a query is made to the registry of a compatible type of the given type.
T - the public type of the registry entrytype - the public type of the registry entryfactory - the factory for creating the object when needed<T> void remove(Class<T> type) throws NotInRegistryException
T - The type of the thing to removetype - The type of the thing to removeNotInRegistryException - if there is nothing registered by that type