public class ClassSelector extends ObjectSelector<java.lang.Class<?>>
Selector that uses Class.isAssignableFrom(Class) to determine a match.| Constructor and Description |
|---|
ClassSelector(java.lang.Class<?> type)
Creates a new ClassSelector that will match keys that are the same as, or are a
super type of the given
type, i.e. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
matches(java.lang.Object key)
Indicates whether this Selector matches the
key. |
static Selector |
typeSelector(java.lang.Class<?> supertype)
Creates a
ClassSelector based on the given class type that only matches if the
key being matched is assignable according to Class.isAssignableFrom(Class). |
clone, getHeaderResolver, getObject, objectSelector, test, toStringpublic ClassSelector(java.lang.Class<?> type)
type, i.e. the key is assignable according to
Class.isAssignableFrom(Class).type - The type to matchpublic static Selector typeSelector(java.lang.Class<?> supertype)
ClassSelector based on the given class type that only matches if the
key being matched is assignable according to Class.isAssignableFrom(Class).supertype - The supertype to compare.Selector.public boolean matches(java.lang.Object key)
Selectorkey.matches in interface Selectormatches in class ObjectSelector<java.lang.Class<?>>key - The key to matchtrue if there's a match, otherwise false.