1 5 package org.easymock.internal; 6 7 import java.lang.reflect.Method ; 8 9 import org.easymock.ArgumentsMatcher; 10 11 public class ExpectedMethodCall { 12 13 private final MethodCall methodCall; 14 15 private final ArgumentsMatcher matcher; 16 17 public ExpectedMethodCall(Method method, Object [] arguments, 18 ArgumentsMatcher matcher) { 19 this.methodCall = new MethodCall(method, arguments); 20 this.matcher = matcher; 21 } 22 23 public boolean equals(Object o) { 24 if (o == null || !this.getClass().equals(o.getClass())) 25 return false; 26 27 ExpectedMethodCall other = (ExpectedMethodCall) o; 28 return this.methodCall.equals(other.methodCall) 29 && this.matcher.equals(other.matcher); 30 } 31 32 public int hashCode() { 33 return methodCall.hashCode(); 34 } 35 36 public boolean matches(MethodCall actualCall) { 37 return this.methodCall.matches(actualCall, matcher); 38 } 39 40 public boolean matches(Method method, Object [] arguments) { 41 return matches(new MethodCall(method, arguments)); 42 } 43 44 public String toString() { 45 return methodCall.toString(matcher); 46 } 47 } 48 | Popular Tags |