public static class

Factory.Named.Util

extends Object
java.lang.Object
   ↳ net.schmizz.sshj.common.Factory.Named.Util

Class Overview

Utility functions

Summary

Public Constructors
Factory.Named.Util()
Public Methods
static <T> T create(List<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> Named<T> get(List<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<Named<T>> factories)
Get a comma-delimited string containing the factory names from the given list of factories.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Factory.Named.Util ()

Public Methods

public static T create (List<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. Uses the first match.

Parameters
factories List of available factories
name Name of the desired factory
Returns
  • a newly created instance of T or null if there was no match

public static Named<T> get (List<Named<T>> factories, String name)

Retrieve a particular factory as identified by name from a list of named factories. Returns the first match.

Parameters
factories List of factories
name The name of the factory to retrieve
Returns
  • a factory or null if there was no match

public static List<String> getNames (List<Named<T>> factories)

Get a comma-delimited string containing the factory names from the given list of factories.

Parameters
factories List of available factories
Returns
  • a comma separated list of factory names