⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.functors

Class IdentityPredicate

java.lang.Object
|
+--org.apache.commons.collections.functors.IdentityPredicate

All Implemented Interfaces:
Predicate, Serializable


public final class IdentityPredicate
extends java.lang.Object
implements Predicate, Serializable

Predicate implementation that returns true if the input is the same object as the one stored in this predicate.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

IdentityPredicate(Object object)

Constructor that performs no validation.

Method Summary

boolean

evaluate(Object object)

Return the predicate result.

static Predicate

getInstance(Object object)

Factory to create the identity predicate.

Constructor Details

IdentityPredicate

public IdentityPredicate(Object object)

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

Parameters:
object - the object to compare to

Method Details

evaluate

public boolean evaluate(Object object)

Return the predicate result.

Parameters:
object

getInstance

public static Predicate getInstance(Object object)

Factory to create the identity predicate.

Parameters:
object - the object to compare to
Returns:
the predicate
Throws:
- if the predicate is null