Top Description Fields Constructors Methods
org.apache.commons.collections4.functors

public final Class EqualPredicate<T>

extends Object
implements Predicate<T>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.apache.commons.collections4.Predicate
Imports
java.io.Serializable, org.apache.commons.collections4.Equator, .Predicate

Predicate implementation that returns true if the input is the same object as the one stored in this predicate by equals.
Since
3.0

Field Summary

Modifier and TypeField and Description
private final Equator<T>
equator

The equator to use for comparison

private final T
iValue

The value to compare to

private static final long
serialVersionUID

Serial version UID

Constructor Summary

AccessConstructor and Description
public
EqualPredicate(final T
the object to compare to
object
)

Constructor that performs no validation.

public
EqualPredicate(final T
the object to compare to
object
,
final Equator<T>
the equator to use for comparison
equator
)

Constructor that performs no validation.

Method Summary

Modifier and TypeMethod and Description
public static <
the type that the predicate queries
T
>
Predicate<T>

Returns:

the predicate
equalPredicate
(final T
the object to compare to
object
)

Factory to create the predicate.

public static <
the type that the predicate queries
T
>
Predicate<T>

Returns:

the predicate
equalPredicate
(final T
the object to compare to
object
,
final Equator<T>
the equator to use for comparison
equator
)

Factory to create the identity predicate.

public boolean

Returns:

true if input object equals stored value
evaluate
(final T
the input object
object
)

Implements org.apache.commons.collections4.Predicate.evaluate.

Evaluates the predicate returning true if the input equals the stored value.
public Object

Returns:

the value
getValue
()

Gets the value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

equatorback to summary
private final Equator<T> equator

The equator to use for comparison

iValueback to summary
private final T iValue

The value to compare to

serialVersionUIDback to summary
private static final long serialVersionUID

Serial version UID

Constructor Detail

EqualPredicateback to summary
public EqualPredicate(final T object)

Constructor that performs no validation. Use equalPredicate if you want that.

Parameters
object:T

the object to compare to

EqualPredicateback to summary
public EqualPredicate(final T object, final Equator<T> equator)

Constructor that performs no validation. Use equalPredicate if you want that.

Parameters
object:T

the object to compare to

equator:Equator<T>

the equator to use for comparison

Since
4.0

Method Detail

equalPredicateback to summary
public static <T> Predicate<T> equalPredicate(final T object)

Factory to create the predicate.

Parameters
<T>
the type that the predicate queries
object:T

the object to compare to

Returns:Predicate<T>

the predicate

equalPredicateback to summary
public static <T> Predicate<T> equalPredicate(final T object, final Equator<T> equator)

Factory to create the identity predicate.

Parameters
<T>
the type that the predicate queries
object:T

the object to compare to

equator:Equator<T>

the equator to use for comparison

Returns:Predicate<T>

the predicate

Since
4.0
evaluateback to summary
public boolean evaluate(final T object)

Implements org.apache.commons.collections4.Predicate.evaluate.

Evaluates the predicate returning true if the input equals the stored value.

Parameters
object:T

the input object

Returns:boolean

true if input object equals stored value

Annotations
@Override
getValueback to summary
public Object getValue()

Gets the value.

Returns:Object

the value

Since
3.1