public static final class NamedResource.Utils extends Object
NamedResource
sModifier and Type | Method and Description |
---|---|
static <R extends NamedResource> |
findByName(String name,
Comparator<? super String> c,
Collection<? extends R> resources) |
static List<String> |
getNameList(Collection<? extends NamedResource> resources) |
static String |
getNames(Collection<? extends NamedResource> resources) |
static <R extends NamedResource> |
removeByName(String name,
Comparator<? super String> c,
Collection<? extends R> resources)
Remove the resource identified by the name from the list.
|
public static List<String> getNameList(Collection<? extends NamedResource> resources)
resources
- The named resourcesList
of all the factories names - in same order
as they appear in the input collectionpublic static String getNames(Collection<? extends NamedResource> resources)
resources
- list of available resourcespublic static <R extends NamedResource> R removeByName(String name, Comparator<? super String> c, Collection<? extends R> resources)
R
- The generic resource typename
- Name of the resource - ignored if null
/emptyc
- The Comparator
to decide whether the NamedResource.getName()
matches the name parameterresources
- The NamedResource
to check - ignored if null
/emptynull
if not in the listpublic static <R extends NamedResource> R findByName(String name, Comparator<? super String> c, Collection<? extends R> resources)
R
- The generic resource typename
- Name of the resource - ignored if null
/emptyc
- The Comparator
to decide whether the NamedResource.getName()
matches the name parameterresources
- The NamedResource
to check - ignored if null
/emptyComparator.compare(Object, Object)
- null
if no match foundCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.