public final class InstanceofPredicate extends Objectimplements Predicate <Object >, Serializable
| Constructor and Description |
|---|
InstanceofPredicate(Class
Constructor that performs no validation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
evaluate(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 |
instanceOfPredicate(Class
Factory to create the identity predicate.
|
public InstanceofPredicate(Class<?> type)
instanceOfPredicate if you want that.
type - the type to check for
public static Predicate<Object > instanceOfPredicate(Class <?> type)
type - the type to check for, may not be null
NullPointerException - if the class is null
public boolean evaluate(Objectobject)
public Class<?> getType()