View Javadoc
1 /* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */ 2 package org.jmock.constraint; 3 4 import org.jmock.Constraint; 5 6 /*** 7 * Is the value the same object as another value? 8 */ 9 public class IsSame implements Constraint { 10 private Object _object; 11 12 /*** 13 * Creates a new instance of IsSame 14 * 15 * @param o The predicate evaluates to true only when the argument is 16 * this object. 17 */ 18 public IsSame(Object o) { 19 _object = o; 20 } 21 22 public boolean eval(Object arg) { 23 return arg == _object; 24 } 25 26 public String toString() { 27 return "the same object as <" + _object + ">"; 28 } 29 }

This page was automatically generated by Maven