public final class BoundPredicate extends Object implements Predicate, Serializable
UnaryPredicate
to the
Predicate interface
using a constant unary argument.
Note that although this class implements
Serializable, a given instance will
only be truly Serializable if the
underlying objects are. Attempts to serialize
an instance whose delegates are not
Serializable will result in an exception.| Constructor and Description |
|---|
BoundPredicate(UnaryPredicate<? super A> predicate,
A arg)
Create a new BoundPredicate instance.
|
| Modifier and Type | Method and Description |
|---|---|
static <A> BoundPredicate |
bind(UnaryPredicate<? super A> predicate,
A arg)
Adapt the given, possibly-
null,
UnaryPredicate to the
Predicate interface by binding
the specified Object as a constant
argument. |
boolean |
equals(BoundPredicate that)
Learn whether another BoundPredicate is equal to this.
|
boolean |
equals(Object that) |
int |
hashCode() |
boolean |
test()
Evaluate this predicate.
|
String |
toString() |
public BoundPredicate(UnaryPredicate<? super A> predicate, A arg)
A - input typepredicate - the predicate to adaptarg - the constant argument to usepublic boolean test()
public boolean equals(BoundPredicate that)
that - BoundPredicate to testpublic static <A> BoundPredicate bind(UnaryPredicate<? super A> predicate, A arg)
null,
UnaryPredicate to the
Predicate interface by binding
the specified Object as a constant
argument.
When the given UnaryPredicate is null,
returns null.A - input typepredicate - the possibly-null
UnaryPredicate to adaptarg - the object to bind as a constant argumentBoundPredicate wrapping the given
UnaryPredicate, or null
if the given UnaryPredicate is nullCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.