public final class IdentityPredicate<T> extends java.lang.Object implements Predicate<T>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private T |
iValue
The value to compare to
|
private static long |
serialVersionUID
Serial version UID
|
Constructor and Description |
---|
IdentityPredicate(T object)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(T object)
Evaluates the predicate returning true if the input object is identical to
the stored object.
|
T |
getValue()
Gets the value.
|
static <T> Predicate<T> |
identityPredicate(T object)
Factory to create the identity predicate.
|
private static final long serialVersionUID
private final T iValue
public IdentityPredicate(T object)
identityPredicate
if you want that.object
- the object to compare topublic static <T> Predicate<T> identityPredicate(T object)
T
- the type that the predicate queriesobject
- the object to compare tojava.lang.IllegalArgumentException
- if the predicate is nullpublic boolean evaluate(T object)
public T getValue()