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

Class OrPredicate

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

All Implemented Interfaces:
Predicate, Serializable


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

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

Constructor Summary

OrPredicate(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

OrPredicate

public OrPredicate(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