Class OrCriterion<T>
- java.lang.Object
-
- com.saperion.common.lang.criterion.OrCriterion<T>
-
- Type Parameters:
T
- type of testable objects
- All Implemented Interfaces:
Criterion<T>
public final class OrCriterion<T> extends java.lang.Object implements Criterion<T>
A
Criterion
that recombines two existing criteria.Objects satisfy this
OrCriterion
if and only if they satisfy at least one constituting criterion.This implementation is not synchronized. If the two constituting criteria are independent of each other (no side effects) and can be used by multiple threads concurrently, this
OrCriterion
can be used by multiple threads concurrently as well. In any other case if used by different threads concurrently, external synchronization is necessary.- Author:
- agz
-
-
Constructor Summary
Constructors Constructor Description OrCriterion(Criterion<? super T> criterion1, Criterion<? super T> criterion2)
Creates a newOrCriterion
, that combines the two specified criteria.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isSatisfiedBy(T object)
Returns whether the specified object satisfies this criterion.java.lang.String
toString()
-
-
-
Constructor Detail
-
OrCriterion
public OrCriterion(Criterion<? super T> criterion1, Criterion<? super T> criterion2)
Creates a newOrCriterion
, that combines the two specified criteria. The specified criteria must not benull
.
-
-
Method Detail
-
isSatisfiedBy
public boolean isSatisfiedBy(T object)
Description copied from interface:Criterion
Returns whether the specified object satisfies this criterion. Implementations have to acceptnull
-values without throwing exceptions.- Specified by:
isSatisfiedBy
in interfaceCriterion<T>
- Parameters:
object
- object to test- Returns:
- whether the specified object satisfies this criterion
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-