1 3 package org.jmock.core.constraint; 4 5 import org.jmock.core.Constraint; 6 7 8 11 public class IsInstanceOf implements Constraint 12 { 13 private Class theClass; 14 15 21 public IsInstanceOf( Class theClass ) { 22 this.theClass = theClass; 23 } 24 25 public boolean eval( Object arg ) { 26 return theClass.isInstance(arg); 27 } 28 29 public StringBuffer describeTo( StringBuffer buffer ) { 30 return buffer.append("an instance of ") 31 .append(theClass.getName()); 32 } 33 } 34 | Popular Tags |