java.io.Serializable
, PredicateDecorator<T>
, Predicate<T>
public final class OrPredicate<T> extends java.lang.Object implements PredicateDecorator<T>, java.io.Serializable
Constructor | Description |
---|---|
OrPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Constructor that performs no validation.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
evaluate(T object) |
Evaluates the predicate returning true if either predicate returns true.
|
Predicate<? super T>[] |
getPredicates() |
Gets the two predicates being decorated as an array.
|
static <T> Predicate<T> |
orPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Factory to create the predicate.
|
public static <T> Predicate<T> orPredicate(Predicate<? super T> predicate1, Predicate<? super T> predicate2)
T
- the type that the predicate queriespredicate1
- the first predicate to check, not nullpredicate2
- the second predicate to check, not nulland
predicatejava.lang.NullPointerException
- if either predicate is nullpublic boolean evaluate(T object)
public Predicate<? super T>[] getPredicates()
getPredicates
in interface PredicateDecorator<T>
Copyright © 2001-2019 - Apache Software Foundation