Class NotCriterion<T>
- java.lang.Object
-
- com.saperion.common.lang.criterion.NotCriterion<T>
-
- Type Parameters:
T- type of testable objects
- All Implemented Interfaces:
Criterion<T>
public final class NotCriterion<T> extends java.lang.Object implements Criterion<T>
A
Criterionthat negates an existingCriterion.Objects satisfy this
NotCriterionif and only if they do not satisfy the constitutingCriterion.This implementation is not synchronized. If the constituting criterion can be used by multiple threads concurrently, this
OrCriterioncan be used by multiple threads concurrently as well. Else if used by different threads concurrently, external synchronization is necessary.- Author:
- agz
-
-
Constructor Summary
Constructors Constructor Description NotCriterion(Criterion<? super T> criterion)Creates a newNotCriterionbased on the specifiedCriterion.NotCriterion(Criterion<? super T> criterion, CriterionIsSatisfiedByNullType criterionIsSatisfiedByNullType)Creates a newNotCriterionbased on the specifiedCriterionwith the specifiedCriterionIsSatisfiedByNullType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisSatisfiedBy(T object)Returns whether the specified object satisfies this criterion.java.lang.StringtoString()
-
-
-
Constructor Detail
-
NotCriterion
public NotCriterion(Criterion<? super T> criterion, CriterionIsSatisfiedByNullType criterionIsSatisfiedByNullType)
Creates a newNotCriterionbased on the specifiedCriterionwith the specifiedCriterionIsSatisfiedByNullType. The specifiedCriterionmust not benull. If the specifiedCriterionIsSatisfiedByNullTypeisnullit will default toCriterionIsSatisfiedByNullType.EVALUATE- Parameters:
criterion- underlyingCriterioncriterionIsSatisfiedByNullType-CriterionIsSatisfiedByNullType.EVALUATE
-
NotCriterion
public NotCriterion(Criterion<? super T> criterion)
Creates a newNotCriterionbased on the specifiedCriterion. The specifiedCriterionmust not benull. TheCriterionIsSatisfiedByNullTypewill default toCriterionIsSatisfiedByNullType.EVALUATE- Parameters:
criterion- underlyingCriterion
-
-
Method Detail
-
isSatisfiedBy
public boolean isSatisfiedBy(T object)
Description copied from interface:CriterionReturns whether the specified object satisfies this criterion. Implementations have to acceptnull-values without throwing exceptions.- Specified by:
isSatisfiedByin interfaceCriterion<T>- Parameters:
object- object to test- Returns:
- whether the specified object satisfies this criterion
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-