public static class Factory.Named.Util
extends java.lang.Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
create(java.util.List<Factory.Named<T>> factories,
java.lang.String name)
Creates an object by picking a factory from
factories that is identified by name from a
list of named factories. |
static <T> Factory.Named<T> |
get(java.util.List<Factory.Named<T>> factories,
java.lang.String name)
Retrieve a particular factory as identified by
name from a list of named factories. |
static <T> java.util.List<java.lang.String> |
getNames(java.util.List<Factory.Named<T>> factories)
Get a comma-delimited string containing the factory names from the given list of
factories. |
public static <T> T create(java.util.List<Factory.Named<T>> factories, java.lang.String name)
factories that is identified by name from a
list of named factories. Uses the first match.T - type of the factoriesfactories - list of available factoriesname - name of the desired factoryT or null if there was no matchpublic static <T> Factory.Named<T> get(java.util.List<Factory.Named<T>> factories, java.lang.String name)
name from a list of named factories.
Returns the first match.T - type of the factoriesfactories - list of factoriesname - the name of the factory to retrievenull if there was no matchpublic static <T> java.util.List<java.lang.String> getNames(java.util.List<Factory.Named<T>> factories)
factories.T - type of the factoriesfactories - list of available factories