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

public final Class IdentityPredicate<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.Predicate

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

Field Summary

Modifier and TypeField and Description
private final T
iValue

The value to compare to

private static final long
serialVersionUID

Serial version UID

Constructor Summary

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

Constructor that performs no validation.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if input is the same object as the stored value
evaluate
(final T
the input object
object
)

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

Evaluates the predicate returning true if the input object is identical to the stored object.
public T

Returns:

the value
getValue
()

Gets the value.

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

Returns:

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

Factory to create the identity predicate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

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

IdentityPredicateback to summary
public IdentityPredicate(final T object)

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

Parameters
object:T

the object to compare to

Method Detail

evaluateback to summary
public boolean evaluate(final T object)

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

Evaluates the predicate returning true if the input object is identical to the stored object.

Parameters
object:T

the input object

Returns:boolean

true if input is the same object as the stored value

Annotations
@Override
getValueback to summary
public T getValue()

Gets the value.

Returns:T

the value

Since
3.1
identityPredicateback to summary
public static <T> Predicate<T> identityPredicate(final T object)

Factory to create the identity predicate.

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

the object to compare to

Returns:Predicate<T>

the predicate