|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.functors.InstanceofPredicate<T>
public final class InstanceofPredicate<T>
Predicate implementation that returns true if the input is an instanceof the type stored in this predicate.
Constructor Summary | |
---|---|
InstanceofPredicate(Class<T> type)
Constructor that performs no validation. |
Method Summary | ||
---|---|---|
boolean |
evaluate(T object)
Evaluates the predicate returning true if the input object is of the correct type. |
|
static
|
getInstance(Class<T> type)
Factory to create the identity predicate. |
|
Class<T> |
getType()
Gets the type to compare to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InstanceofPredicate(Class<T> type)
getInstance
if you want that.
type
- the type to check forMethod Detail |
---|
public static <T> Predicate<T> getInstance(Class<T> type)
type
- the type to check for, may not be null
IllegalArgumentException
- if the class is nullpublic boolean evaluate(T object)
evaluate
in interface Predicate<T>
object
- the input object
public Class<T> getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |