Class 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 Criterion that tests instances against a specified class.

    Objects satisfy this InstanceOfCriterion if and only if they are an instance of the specified class.

    An instance of this InstanceOfCriterion can be used in several threads concurrently.

    Author:
    agz
    • 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • InstanceOfCriterion

        public InstanceOfCriterion​(java.lang.Class<? extends T> clazz)
        Creates a new InstanceOfCriterion based on the specified Class.

        The specified Class must not be null.

        Parameters:
        clazz - Class to test the objects against
    • Method Detail

      • isSatisfiedBy

        public boolean isSatisfiedBy​(T object)
        Description copied from interface: Criterion
        Returns whether the specified object satisfies this criterion.

        Implementations have to accept null-values without throwing exceptions.

        Specified by:
        isSatisfiedBy in interface Criterion<T>
        Parameters:
        object - object to test
        Returns:
        whether the specified object satisfies this criterion
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object