public static class Factory.Named.Util extends Object
Constructor and Description |
---|
Factory.Named.Util() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
create(List<Factory.Named<T>> factories,
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(List<Factory.Named<T>> factories,
String name)
Retrieve a particular factory as identified by
name from a list of named factories . |
static <T> List<String> |
getNames(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(List<Factory.Named<T>> factories, String name)
factories
that is identified by name
from a
list of named factories
. Uses the first match.T
- type of the factories
factories
- list of available factoriesname
- name of the desired factoryT
or null
if there was no matchpublic static <T> Factory.Named<T> get(List<Factory.Named<T>> factories, String name)
name
from a list of named factories
.
Returns the first match.T
- type of the factories
factories
- list of factoriesname
- the name of the factory to retrievenull
if there was no matchpublic static <T> List<String> getNames(List<Factory.Named<T>> factories)
factories
.T
- type of the factories
factories
- list of available factoriesCopyright © 2009-2013. All Rights Reserved.