public final class EqualPredicate<T> extends Object implements Predicate<T>, Serializable
Constructor and Description |
---|
EqualPredicate(T object)
Constructor that performs no validation.
|
EqualPredicate(T object,
Equator<T> equator)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
equalPredicate(T object)
Factory to create the predicate.
|
static <T> Predicate<T> |
equalPredicate(T object,
Equator<T> equator)
Factory to create the identity predicate.
|
boolean |
evaluate(T object)
Evaluates the predicate returning true if the input equals the stored value.
|
Object |
getValue()
Gets the value.
|
public EqualPredicate(T object)
equalPredicate
if you want that.object
- the object to compare topublic static <T> Predicate<T> equalPredicate(T object)
T
- the type that the predicate queriesobject
- the object to compare toIllegalArgumentException
- if the predicate is nullpublic static <T> Predicate<T> equalPredicate(T object, Equator<T> equator)
T
- the type that the predicate queriesobject
- the object to compare toequator
- the equator to use for comparisonIllegalArgumentException
- if the predicate is nullpublic boolean evaluate(T object)
public Object getValue()
Copyright © 2001–2013 The Apache Software Foundation. All rights reserved.