/* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */
package org.jmock.matcher;
import org.jmock.Constraint;
import org.jmock.constraint.IsEqual;
import org.jmock.dynamic.Invocation;
public class MethodNameMatcher
extends StatelessInvocationMatcher {
private Constraint constraint;
public MethodNameMatcher(Constraint constraint) {
this.constraint = constraint;
}
public MethodNameMatcher(String methodName) {
this(new IsEqual(methodName));
}
public boolean matches(Invocation invocation) {
return constraint.eval(invocation.getMethodName());
}
}