public class DurianPlugins
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
get(java.lang.Class<T> pluginClass,
T defaultImpl)
Returns an instance of pluginClass which is guaranteed to be identical throughout
the runtime existence of this library.
|
static <T> void |
register(java.lang.Class<T> pluginClass,
T pluginImpl)
Registers an implementation as a global override of any injected or default implementations.
|
public static <T> void register(java.lang.Class<T> pluginClass,
T pluginImpl)
throws java.lang.IllegalStateException
pluginClass - The interface which is being registered.pluginImpl - The implementation of that interface which is being registered.java.lang.IllegalStateException - If called more than once or if a value has already been requested.public static <T> T get(java.lang.Class<T> pluginClass,
T defaultImpl)
pluginClass - The interface which is being requested.defaultImpl - A default implementation of that interface.