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

Class AndPredicate

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

All Implemented Interfaces:
Predicate, Serializable


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

Predicate implementation that returns true if both the predicates return true.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

AndPredicate(Predicate predicate1, Predicate predicate2)

Constructor that performs no validation.

Method Summary

boolean

evaluate(Object object)

Return the predicate result.

static Predicate

getInstance(Predicate predicate1, Predicate predicate2)

Factory to create the predicate.

Constructor Details

AndPredicate

public AndPredicate(Predicate predicate1, Predicate predicate2)

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

Parameters:
predicate1 - the first predicate to check, not null
predicate2 - the second predicate to check, not null

Method Details

evaluate

public boolean evaluate(Object object)

Return the predicate result.

Parameters:
object

getInstance

public static Predicate getInstance(Predicate predicate1, Predicate predicate2)

Factory to create the predicate.

Parameters:
predicate1 - the first predicate to check, not null
predicate2 - the second predicate to check, not null
Returns:
the and predicate
Throws:
- if either predicate is null