org.jmock.core.constraint

Class IsInstanceOf

Implemented Interfaces:
Constraint, SelfDescribing

public class IsInstanceOf
extends Object
implements Constraint

Tests whether the value is an instance of a class.

Constructor Summary

IsInstanceOf(Class theClass)
Creates a new instance of IsInstanceOf

Method Summary

StringBuffer
describeTo(StringBuffer buffer)
boolean
eval(Object arg)
Evaluates the constraint for argument o.

Constructor Details

IsInstanceOf

public IsInstanceOf(Class theClass)
Creates a new instance of IsInstanceOf
Parameters:
theClass - The predicate evaluates to true for instances of this class or one of its subclasses.

Method Details

describeTo

public StringBuffer describeTo(StringBuffer buffer)
Specified by:
describeTo in interface SelfDescribing

eval

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