Top Description Fields Constructors Methods
org.terracotta.context.query

public abstract Class Matcher<T>

extends Object
Class Inheritance
Type Parameters
<T>
the enclosing type of the objects that match
Imports
java.lang.reflect.Method

A matching object that can be used to filter the node-set in a context query chain.

Field Summary

Modifier and TypeField and Description
private final Class<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static <T extends Matcher<?>> Class<?>
getSafeType(Class<T> fromClass)

public final boolean

Returns:

true if the object matches
matches
(Object
object to be checked
object
)

Returns true if this object matches successfully.

protected abstract boolean

Returns:

true on a match
matchesSafely
(T
object to check for a match
object
)

Returns true if the supplied object matches against this matcher.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

boundTypeback to summary
private final Class<T> boundType
Annotations
@SuppressWarnings:unchecked

Constructor Detail

Matcherback to summary
public Matcher()

Method Detail

getSafeTypeback to summary
private static <T extends Matcher<?>> Class<?> getSafeType(Class<T> fromClass)
matchesback to summary
public final boolean matches(Object object)

Returns true if this object matches successfully.

This method checks for a type match against the erased type of this matcher and then defers to the matchesSafely(Object) of this matcher with the type-checked and cast object.

Parameters
object:Object

object to be checked

Returns:boolean

true if the object matches

matchesSafelyback to summary
protected abstract boolean matchesSafely(T object)

Returns true if the supplied object matches against this matcher.

Parameters
object:T

object to check for a match

Returns:boolean

true on a match