public final class InstanceofPredicate extends Object implements Predicate<Object>, Serializable
Constructor and Description |
---|
InstanceofPredicate(Class<?> type)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public InstanceofPredicate(Class<?> type)
instanceOfPredicate
if you want that.type
- the type to check forpublic static Predicate<Object> instanceOfPredicate(Class<?> type)
type
- the type to check for, may not be nullNullPointerException
- if the class is nullpublic boolean evaluate(Object object)
Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.