|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.context.query.Matchers
public final class Matchers
A static library of Matcher implementations that can be used with the
QueryBuilder.filter(Matcher) method.
| Method Summary | ||
|---|---|---|
static
|
allOf(Matcher<? super T>... matchers)
Returns a matcher that matches when against objects which match all of the supplied matchers. |
|
static
|
anyOf(Matcher<? super T>... matchers)
Returns a matcher that matches when against objects which match any of the supplied matchers. |
|
static Matcher<ContextElement> |
attributes(Matcher<Map<String,Object>> matcher)
Returns a matcher that matches context elements whose ContextElement.attributes()
match against the supplied matcher. |
|
static Matcher<TreeNode> |
context(Matcher<ContextElement> matcher)
Returns a matcher that matches tree nodes whose TreeNode.getContext()
match against the supplied matcher. |
|
static Matcher<Map<String,Object>> |
hasAttribute(String key,
Matcher<? extends Object> value)
Returns a matcher that matches attribute maps the include an attribute with the given name, and whose value matches the given matcher. |
|
static Matcher<Map<String,Object>> |
hasAttribute(String key,
Object value)
Returns a matcher that matches attribute maps that include the given attribute entry. |
|
static Matcher<ContextElement> |
identifier(Matcher<Class<?>> matcher)
Returns a matcher that matches context elements whose ContextElement.identifier()
match against the supplied matcher. |
|
static
|
not(Matcher<T> matcher)
|
|
static Matcher<Class<?>> |
subclassOf(Class<?> klazz)
Returns a matcher that matches classes that are sub-types of the supplied class. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Matcher<TreeNode> context(Matcher<ContextElement> matcher)
TreeNode.getContext()
match against the supplied matcher.
matcher - ContextElement matcher
TreeNode matcherpublic static Matcher<ContextElement> attributes(Matcher<Map<String,Object>> matcher)
ContextElement.attributes()
match against the supplied matcher.
matcher - a Map (attributes) matcher
ContextElement matcherpublic static Matcher<ContextElement> identifier(Matcher<Class<?>> matcher)
ContextElement.identifier()
match against the supplied matcher.
matcher - Class<?> matcher
ContextElement matcherpublic static Matcher<Class<?>> subclassOf(Class<?> klazz)
klazz - a potential super-type
Class<?> matcher
public static Matcher<Map<String,Object>> hasAttribute(String key,
Object value)
key - attribute namevalue - attribute value
Map<String, Object> matcher
public static Matcher<Map<String,Object>> hasAttribute(String key,
Matcher<? extends Object> value)
key - attribute namevalue - attribute value matcher
Map<String, Object> matcherpublic static <T> Matcher<T> anyOf(Matcher<? super T>... matchers)
T - type of the object to be matchedmatchers - list of matchers to match
public static <T> Matcher<T> allOf(Matcher<? super T>... matchers)
T - type of the object to be matchedmatchers - list of matchers to match
public static <T> Matcher<T> not(Matcher<T> matcher)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||