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