@FunctionalInterface public interface NamedResource
Modifier and Type | Field and Description |
---|---|
static Comparator<NamedResource> |
BY_NAME_COMPARATOR
Compares 2
NamedResource s according to their getName()
value case insensitive |
static Function<NamedResource,String> |
NAME_EXTRACTOR
|
Modifier and Type | Method and Description |
---|---|
static <R extends NamedResource> |
findByName(String name,
Comparator<? super String> c,
Collection<? extends R> resources) |
String |
getName() |
static List<String> |
getNameList(Collection<? extends NamedResource> resources) |
static String |
getNames(Collection<? extends NamedResource> resources) |
static NamedResource |
ofName(String name)
Wraps a name value inside a
NamedResource |
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.
|
static final Function<NamedResource,String> NAME_EXTRACTOR
static final Comparator<NamedResource> BY_NAME_COMPARATOR
NamedResource
s according to their getName()
value case insensitiveString getName()
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 collectionstatic String getNames(Collection<? extends NamedResource> resources)
resources
- list of available resourcesstatic <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 getName()
matches the name parameterresources
- The NamedResource
to check - ignored if null
/emptynull
if not in the liststatic <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 getName()
matches the name parameterresources
- The NamedResource
to check - ignored if null
/emptyComparator.compare(Object, Object)
- null
if no match foundstatic NamedResource ofName(String name)
NamedResource
name
- The name value to wrapCopyright © 2008–2022 The Apache Software Foundation. All rights reserved.