|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.module.AttributeSource
java.lang.module.AttributeMatcher
public abstract class AttributeMatcher
A Matcher for AttributeSources.
| Field Summary |
|---|
| Fields inherited from class java.lang.module.AttributeSource |
|---|
NO_ATTRIBUTES, SERVICE_IMPLEMENTATION_KEY |
| Constructor Summary | |
|---|---|
protected |
AttributeMatcher(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes)
Constructor. |
| Method Summary | |
|---|---|
static AttributeMatcher |
anyMatcher()
Returns an @AttributeMatcher that matches any attributes. |
boolean |
containsAttribute(java.lang.String key)
Returns true if the specified attribute is present in
this instance. |
static AttributeMatcher |
containsMatcher(java.util.Map<java.lang.String,java.lang.String> attributes)
Returns an AttributeMatcher that matches if all specified
attributes are contained in the target AttributeSource. |
static AttributeMatcher |
containsMatcher(java.lang.String... keyValuePairs)
Returns an AttributeMatcher that matches if all specified
attributes are contained in the target AttributeSource. |
static AttributeMatcher |
equalsMatcher(java.util.Map<java.lang.String,java.lang.String> attributes)
Returns an AttributeMatcher that matches if the specified
attributes are equal to those of the target AttributeSource. |
static AttributeMatcher |
equalsMatcher(java.lang.String... keyValuePairs)
Returns an AttributeMatcher that matches if the specified
attributes are equal to those of the AttributeSource. |
java.lang.String |
getAttribute(java.lang.String key)
Returns the attribute value. |
java.util.List<java.lang.String> |
getAttributeAsList(java.lang.String key)
Returns the attribute value as a list. |
java.util.Set<java.lang.String> |
getAttributeKeys()
Returns an unmodifiable set of the attribute keys. |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Returns an unmodifiable map of the attributes. |
java.lang.String |
getName()
Returns the name of this instance. |
abstract boolean |
matches(AttributeSource target)
Tests if the specified target matches this instance. |
static java.util.Map<java.lang.String,java.lang.String> |
newAttributes(java.lang.String... keyValuePairs)
Returns a new attribute map. |
java.lang.String |
toString()
Returns a string representation of this matcher. |
| Methods inherited from class java.lang.module.AttributeSource |
|---|
appendAttributes, asList, containsAttributes, modifiableList, unmodifiableMap, unmodifiableMap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected AttributeMatcher(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes)
name - A descriptor for this matcher.attributes - The attributes to match.| Method Detail |
|---|
public static java.util.Map<java.lang.String,java.lang.String> newAttributes(java.lang.String... keyValuePairs)
keyValuePairs - The key/value pairs.
java.lang.IllegalArgumentException - if keyValuePairs.length is odd.public static AttributeMatcher equalsMatcher(java.lang.String... keyValuePairs)
AttributeMatcher that matches if the specified
attributes are equal to those of the AttributeSource.
keyValuePairs - The key/value pairs.
java.lang.IllegalArgumentException - if keyValuePairs.length is odd.public static AttributeMatcher equalsMatcher(java.util.Map<java.lang.String,java.lang.String> attributes)
AttributeMatcher that matches if the specified
attributes are equal to those of the target AttributeSource.
attributes - The attributes to match.
public static AttributeMatcher containsMatcher(java.lang.String... keyValuePairs)
AttributeMatcher that matches if all specified
attributes are contained in the target AttributeSource.
keyValuePairs - The key/value pairs.
java.lang.IllegalArgumentException - if keyValuePairs.length is odd.public static AttributeMatcher containsMatcher(java.util.Map<java.lang.String,java.lang.String> attributes)
AttributeMatcher that matches if all specified
attributes are contained in the target AttributeSource.
attributes - The attributes to match.
public static AttributeMatcher anyMatcher()
@AttributeMatcher that matches any attributes.
public java.lang.String getName()
getName in class AttributeSourcepublic boolean containsAttribute(java.lang.String key)
true if the specified attribute is present in
this instance.
containsAttribute in class AttributeSourcekey - The attribute key.
true if the attribute is present.public java.lang.String getAttribute(java.lang.String key)
getAttribute in class AttributeSourcekey - The attribute key.
null if none.public java.util.List<java.lang.String> getAttributeAsList(java.lang.String key)
asList(getAttribute(key)); however, subclasses may
override and change the list format.
getAttributeAsList in class AttributeSourcekey - The attribute key.
public java.util.Set<java.lang.String> getAttributeKeys()
getAttributeKeys in class AttributeSourcepublic java.util.Map<java.lang.String,java.lang.String> getAttributes()
getAttributes in class AttributeSourcepublic abstract boolean matches(AttributeSource target)
matches in interface Matcher<AttributeSource>target - The target instance.
true if the specified target matches this instance;
false otherwise.public java.lang.String toString()
toString in class java.lang.Object
|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||