K
- The type of object held by the selectorT
- The type of object held by the selectorpublic class ObjectSelector<K,T> extends Object implements Selector<K>, Predicate<K>
Selector
implementation that uses the Object.hashCode()
and Object.equals(Object)
methods of the internal object to determine a match.Constructor and Description |
---|
ObjectSelector(T object)
Create a new
Selector instance from the given object. |
Modifier and Type | Method and Description |
---|---|
protected Object |
clone() |
HeaderResolver |
getHeaderResolver()
Return a component that can resolve headers from a key
|
T |
getObject()
Get the object being used for comparisons and equals checks.
|
boolean |
matches(K key)
Indicates whether this Selector matches the
key . |
static <T> Selector<T> |
objectSelector(T obj)
Helper method to create a
Selector from the given object. |
boolean |
test(K t)
Returns true if the input object matches some criteria.
|
String |
toString() |
public static <T> Selector<T> objectSelector(T obj)
Selector
from the given object.T
- The type of the object.obj
- The object to wrap.Selector
.public T getObject()
Selector
public boolean matches(K key)
Selector
key
.public HeaderResolver getHeaderResolver()
Selector
getHeaderResolver
in interface Selector<K>
HeaderResolver
applicable to this Selector
type.public boolean test(K t)
Predicate
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Copyright © 2017. All rights reserved.