T
- the concrete plugin interfaceS
- the delimiter typepublic class SimplePluginRegistry<T extends Plugin<S>,S> extends PluginRegistrySupport<T,S>
PluginRegistry
. Simply holds all given plugins in a list dropping null
values silently on adding.Modifier | Constructor and Description |
---|---|
protected |
SimplePluginRegistry(List<? extends T> plugins)
Creates a new
SimplePluginRegistry . |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T plugin)
Returns whether the registry contains a given plugin.
|
int |
countPlugins()
Returns the number of registered plugins.
|
static <S,T extends Plugin<S>> |
create()
Creates a new
SimplePluginRegistry . |
static <S,T extends Plugin<S>> |
create(List<? extends T> plugins)
Creates a new
SimplePluginRegistry with the given Plugin s. |
T |
getPluginFor(S delimiter)
Returns the first plugin found for the given originating system.
|
<E extends Exception> |
getPluginFor(S delimiter,
E ex)
Retrieves a required plugin from the registry or throw the given exception if none can be found.
|
T |
getPluginFor(S delimiter,
T plugin)
Returns the first
Plugin supporting the given delimiter or the given plugin if none can be found. |
List<T> |
getPlugins()
Returns all registered plugins.
|
List<T> |
getPluginsFor(S delimiter)
Returns all plugins for the given delimiter.
|
<E extends Exception> |
getPluginsFor(S delimiter,
E ex)
Retrieves all plugins for the given delimiter or throws an exception if no plugin can be found.
|
List<T> |
getPluginsFor(S delimiter,
List<? extends T> plugins)
Returns all
Plugin s supporting the given delimiter or the given plugins if none found. |
boolean |
hasPluginFor(S delimiter)
Returns whether the registry contains a
Plugin matching the given delimiter. |
initialize, iterator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static <S,T extends Plugin<S>> SimplePluginRegistry<T,S> create()
SimplePluginRegistry
.T
- the plugin typeS
- the delimiter typepublic static <S,T extends Plugin<S>> SimplePluginRegistry<T,S> create(List<? extends T> plugins)
SimplePluginRegistry
with the given Plugin
s.T
- the plugin typeS
- the delimiter typepublic List<T> getPlugins()
PluginRegistrySupport
getPlugins
in interface PluginRegistry<T extends Plugin<S>,S>
getPlugins
in class PluginRegistrySupport<T extends Plugin<S>,S>
public T getPluginFor(S delimiter)
PluginRegistry
null
if none foundpublic List<T> getPluginsFor(S delimiter)
PluginRegistry
public <E extends Exception> T getPluginFor(S delimiter, E ex) throws E extends Exception
PluginRegistry
E
- the exception type to be thrown in case no plugin can be foundex
- the exception to be thrown in case no plugin can be foundE
- if no plugin can be found for the given delimiterE extends Exception
public <E extends Exception> List<T> getPluginsFor(S delimiter, E ex) throws E extends Exception
PluginRegistry
E
- the exception type to be thrownE
- if no plugin can be foundE extends Exception
public T getPluginFor(S delimiter, T plugin)
PluginRegistry
Plugin
supporting the given delimiter or the given plugin if none can be found.public List<T> getPluginsFor(S delimiter, List<? extends T> plugins)
PluginRegistry
Plugin
s supporting the given delimiter or the given plugins if none found.public int countPlugins()
PluginRegistry
public boolean contains(T plugin)
PluginRegistry
public boolean hasPluginFor(S delimiter)
PluginRegistry
Plugin
matching the given delimiter.Copyright © 2008-2014–2015 Pivotal, Inc.. All rights reserved.