Top Fields Methods
org.apache.sshd.common

public Interface NamedResource

Known Direct Subinterfaces
org.apache.sshd.common.Property, org.apache.sshd.common.auth.UserAuthInstance, org.apache.sshd.common.auth.UserAuthMethodFactory, org.apache.sshd.common.compression.CompressionInformation, org.apache.sshd.common.config.keys.Identity, org.apache.sshd.common.config.keys.loader.openssh.OpenSSHKdfOptions, org.apache.sshd.common.kex.extension.KexExtensionParser, org.apache.sshd.common.random.Random, org.apache.sshd.common.util.io.resource.IoResource, org.apache.sshd.common.util.security.SecurityProviderChoice, org.apache.sshd.common.NamedFactory
Known Direct Implementers
org.apache.sshd.common.cipher.ECCurves
Annotations
@FunctionalInterface
Imports
java.util.Collection, .Comparator, .List, java.util.function.Function, org.apache.sshd.common.util.GenericUtils

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final Comparator<NamedResource>
BY_NAME_COMPARATOR

Compares 2 NamedResources according to their getName() value case insensitive

public static final Function<NamedResource, String>
NAME_EXTRACTOR

Returns the value of getName() - or null if argument is null

Method Summary

Modifier and TypeMethod and Description
public static <
The generic resource type
R extends NamedResource
>
R

Returns:

The first resource whose name matches the parameter (by invoking Comparator#compare(Object, Object) - null if no match found
findByName
(String
Name of the resource - ignored if null/empty
name
,
Comparator<? super String>
The Comparator to decide whether the NamedResource#getName() matches the name parameter
c
,
Collection<? extends R>
The NamedResource to check - ignored if null/empty
resources
)

public static <R extends NamedResource> R
findFirstMatchByName(Collection<String> names, Comparator<? super String> c, Collection<? extends R> resources)

public String

Returns:

The resource name
getName
()

public static List<String>

Returns:

A List of all the factories names - in same order as they appear in the input collection
getNameList
(Collection<? extends NamedResource>
The named resources
resources
)

public static String

Returns:

A comma separated list of factory names
getNames
(Collection<? extends NamedResource>
list of available resources
resources
)

public static NamedResource

Returns:

The wrapper instance
ofName
(String
The name value to wrap
name
)

Wraps a name value inside a NamedResource

public static <
The generic resource type
R extends NamedResource
>
R

Returns:

the removed resource from the list or null if not in the list
removeByName
(String
Name of the resource - ignored if null/empty
name
,
Comparator<? super String>
The Comparator to decide whether the NamedResource#getName() matches the name parameter
c
,
Collection<? extends R>
The NamedResource to check - ignored if null/empty
resources
)

Remove the resource identified by the name from the list.

public static int
safeCompareByName(NamedResource r1, NamedResource r2, boolean caseSensitive)

Field Detail

BY_NAME_COMPARATORback to summary
public static final Comparator<NamedResource> BY_NAME_COMPARATOR

Compares 2 NamedResources according to their getName() value case insensitive

NAME_EXTRACTORback to summary
public static final Function<NamedResource, String> NAME_EXTRACTOR

Returns the value of getName() - or null if argument is null

Method Detail

findByNameback to summary
public static <R extends NamedResource> R findByName(String name, Comparator<? super String> c, Collection<? extends R> resources)
Parameters
<R>
The generic resource type
name:String

Name of the resource - ignored if null/empty

c:Comparator<? super String>

The Comparator to decide whether the NamedResource#getName() matches the name parameter

resources:Collection<? extends R>

The NamedResource to check - ignored if null/empty

Returns:R

The first resource whose name matches the parameter (by invoking Comparator#compare(Object, Object) - null if no match found

findFirstMatchByNameback to summary
public static <R extends NamedResource> R findFirstMatchByName(Collection<String> names, Comparator<? super String> c, Collection<? extends R> resources)
getNameback to summary
public String getName()
Returns:String

The resource name

getNameListback to summary
public static List<String> getNameList(Collection<? extends NamedResource> resources)
Parameters
resources:Collection<? extends NamedResource>

The named resources

Returns:List<String>

A List of all the factories names - in same order as they appear in the input collection

getNamesback to summary
public static String getNames(Collection<? extends NamedResource> resources)
Parameters
resources:Collection<? extends NamedResource>

list of available resources

Returns:String

A comma separated list of factory names

ofNameback to summary
public static NamedResource ofName(String name)

Wraps a name value inside a NamedResource

Parameters
name:String

The name value to wrap

Returns:NamedResource

The wrapper instance

removeByNameback to summary
public static <R extends NamedResource> R removeByName(String name, Comparator<? super String> c, Collection<? extends R> resources)

Remove the resource identified by the name from the list.

Parameters
<R>
The generic resource type
name:String

Name of the resource - ignored if null/empty

c:Comparator<? super String>

The Comparator to decide whether the NamedResource#getName() matches the name parameter

resources:Collection<? extends R>

The NamedResource to check - ignored if null/empty

Returns:R

the removed resource from the list or null if not in the list

safeCompareByNameback to summary
public static int safeCompareByName(NamedResource r1, NamedResource r2, boolean caseSensitive)