T
- the binary predicate input typespublic final class IsEquivalent<T> extends Object implements BinaryPredicate<T,T>
BinaryPredicate
that tests
true
iff the left argument is equal to the
right argument under the specified Comparator
.
When no (or a null
Comparator
is specified,
a Comparable
Comparator
is used.IsEqual
Modifier and Type | Field and Description |
---|---|
static IsEquivalent<Comparable<?>> |
INSTANCE
Basic IsEquivalent instance.
|
Constructor and Description |
---|
IsEquivalent()
Create a new IsEquivalent.
|
IsEquivalent(Comparator<? super T> comparator)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
static <T extends Comparable<?>> |
instance()
Get a basic IsEquivalent instance.
|
static <T extends Comparable<?>> |
instance(T right)
Get an IsEquivalent instance that always compares to
arg . |
boolean |
test(T left,
T right)
Return
true iff the left parameter is
equal to the right parameter under my current
Comparator . |
String |
toString() |
public static final IsEquivalent<Comparable<?>> INSTANCE
public IsEquivalent()
public IsEquivalent(Comparator<? super T> comparator)
comparator
- the Comparator
, when null
,
a Comparator
for Comparable
s will
be used.public boolean test(T left, T right)
true
iff the left parameter is
equal to the right parameter under my current
Comparator
.
Evaluate this predicate.test
in interface BinaryPredicate<T,T>
left
- the L element of the ordered pair of argumentsright
- the R element of the ordered pair of argumentspublic static <T extends Comparable<?>> IsEquivalent<T> instance()
T
- the binary predicate input typespublic static <T extends Comparable<?>> Predicate<T> instance(T right)
arg
.T
- the predicate input typeright
- argumentCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.