public final class EqualPredicate<T> extends java.lang.Object implements Predicate<T>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private Equator<T> |
equator
The equator to use for comparison
|
private T |
iValue
The value to compare to
|
private static long |
serialVersionUID
Serial version UID
|
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.
|
java.lang.Object |
getValue()
Gets the value.
|
private static final long serialVersionUID
private final T iValue
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 tojava.lang.IllegalArgumentException
- 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 comparisonjava.lang.IllegalArgumentException
- if the predicate is nullpublic boolean evaluate(T object)
public java.lang.Object getValue()