org.apache.commons.collections.functors

Class EqualPredicate

Implemented Interfaces:
Predicate, Serializable

public final class EqualPredicate
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 by equals.
Version:
$Revision: 1.5 $ $Date: 2004/05/16 11:16:01 $
Author:
Stephen Colebourne
Since:
Commons Collections 3.0

Constructor Summary

EqualPredicate(Object object)
Constructor that performs no validation.

Method Summary

boolean
evaluate(Object object)
Evaluates the predicate returning true if the input equals the stored value.
static Predicate
getInstance(Object object)
Factory to create the identity predicate.
Object
getValue()
Gets the value.

Constructor Details

EqualPredicate

public EqualPredicate(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)
Evaluates the predicate returning true if the input equals the stored value.
Specified by:
evaluate in interface Predicate
Parameters:
object - the input object
Returns:
true if input object equals stored value

getInstance

public static Predicate getInstance(Object object)
Factory to create the identity predicate.
Parameters:
object - the object to compare to
Returns:
the predicate

getValue

public Object getValue()
Gets the value.
Returns:
the value
Since:
Commons Collections 3.1

Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.