@FunctionalInterface
public interface NamedResource
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<NamedResource> |
BY_NAME_COMPARATOR
Compares 2
NamedResource s according to their getName()
value case insensitive |
static java.util.function.Function<NamedResource,java.lang.String> |
NAME_EXTRACTOR
|
Modifier and Type | Method and Description |
---|---|
static <R extends NamedResource> |
findByName(java.lang.String name,
java.util.Comparator<? super java.lang.String> c,
java.util.Collection<? extends R> resources) |
java.lang.String |
getName() |
static java.util.List<java.lang.String> |
getNameList(java.util.Collection<? extends NamedResource> resources) |
static java.lang.String |
getNames(java.util.Collection<? extends NamedResource> resources) |
static <R extends NamedResource> |
removeByName(java.lang.String name,
java.util.Comparator<? super java.lang.String> c,
java.util.Collection<? extends R> resources)
Remove the resource identified by the name from the list.
|
static final java.util.function.Function<NamedResource,java.lang.String> NAME_EXTRACTOR
static final java.util.Comparator<NamedResource> BY_NAME_COMPARATOR
NamedResource
s according to their getName()
value case insensitivejava.lang.String getName()
static java.util.List<java.lang.String> getNameList(java.util.Collection<? extends NamedResource> resources)
resources
- The named resourcesList
of all the factories names - in same order
as they appear in the input collectionstatic java.lang.String getNames(java.util.Collection<? extends NamedResource> resources)
resources
- list of available resourcesstatic <R extends NamedResource> R removeByName(java.lang.String name, java.util.Comparator<? super java.lang.String> c, java.util.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(java.lang.String name, java.util.Comparator<? super java.lang.String> c, java.util.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 found