Class IsEventFrom

java.lang.Object
com.mockobjects.constraint.IsEventFrom
All Implemented Interfaces:
Constraint

public class IsEventFrom extends Object implements Constraint
Tests if the value is an event announced by a specific object.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IsEventFrom(Class event_class, Object source)
    Constructs an IsEventFrom predicate that returns true for any object derived from event_class announced by source.
    Constructs an IsEventFrom predicate that returns true for any object derived from EventObject announced by source.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Evaluates the constraint for argument o.
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • IsEventFrom

      public IsEventFrom(Object source)
      Constructs an IsEventFrom predicate that returns true for any object derived from EventObject announced by source.
    • IsEventFrom

      public IsEventFrom(Class event_class, Object source)
      Constructs an IsEventFrom predicate that returns true for any object derived from event_class announced by source.
  • Method Details

    • eval

      public boolean eval(Object o)
      Description copied from interface: Constraint
      Evaluates the constraint for argument o.
      Specified by:
      eval in interface Constraint
      Returns:
      true if o meets the constraint, false if it does not.
    • toString

      public String toString()
      Overrides:
      toString in class Object