1 3 package org.jmock.core.constraint; 4 5 import org.jmock.core.Constraint; 6 7 8 13 public class And implements Constraint 14 { 15 Constraint left, right; 16 17 public And( Constraint left, Constraint right ) { 18 this.left = left; 19 this.right = right; 20 } 21 22 public boolean eval( Object o ) { 23 return left.eval(o) && right.eval(o); 24 } 25 26 public StringBuffer describeTo( StringBuffer buffer ) { 27 buffer.append("("); 28 left.describeTo(buffer); 29 buffer.append(" and "); 30 right.describeTo(buffer); 31 buffer.append(")"); 32 return buffer; 33 } 34 } 35 | Popular Tags |