Class InstanceOfCriterion<T>
- java.lang.Object
-
- com.saperion.common.lang.criterion.InstanceOfCriterion<T>
-
- Type Parameters:
T- type of testable objects
- All Implemented Interfaces:
Criterion<T>
public final class InstanceOfCriterion<T> extends java.lang.Object implements Criterion<T>
A
Criterionthat tests instances against a specified class.Objects satisfy this
InstanceOfCriterionif and only if they are an instance of the specified class.An instance of this
InstanceOfCriterioncan be used in several threads concurrently.- Author:
- agz
-
-
Constructor Summary
Constructors Constructor Description InstanceOfCriterion(java.lang.Class<? extends T> clazz)Creates a newInstanceOfCriterionbased on the specifiedClass.
-
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
-
InstanceOfCriterion
public InstanceOfCriterion(java.lang.Class<? extends T> clazz)
Creates a newInstanceOfCriterionbased on the specifiedClass.The specified
Classmust not benull.- Parameters:
clazz-Classto test the objects against
-
-
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
-
-