Package net.schmizz.sshj.common
Class Factory.Named.Util
java.lang.Object
net.schmizz.sshj.common.Factory.Named.Util
- Enclosing interface:
Factory.Named<T>
Utility functions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
create
(List<Factory.Named<T>> factories, String name) Creates an object by picking a factory fromfactories
that is identified byname
from a list of namedfactories
.static <T> Factory.Named
<T> get
(List<Factory.Named<T>> factories, String name) Retrieve a particular factory as identified byname
from a list of namedfactories
.getNames
(List<Factory.Named<T>> factories) Get a comma-delimited string containing the factory names from the given list offactories
.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
create
Creates an object by picking a factory fromfactories
that is identified byname
from a list of namedfactories
. Uses the first match.- Type Parameters:
T
- type of thefactories
- Parameters:
factories
- list of available factoriesname
- name of the desired factory- Returns:
- a newly created instance of
T
ornull
if there was no match
-
get
Retrieve a particular factory as identified byname
from a list of namedfactories
. Returns the first match.- Type Parameters:
T
- type of thefactories
- Parameters:
factories
- list of factoriesname
- the name of the factory to retrieve- Returns:
- a factory or
null
if there was no match
-
getNames
Get a comma-delimited string containing the factory names from the given list offactories
.- Type Parameters:
T
- type of thefactories
- Parameters:
factories
- list of available factories- Returns:
- a comma separated list of factory names
-