Open GoogleCodeExporter opened 9 years ago
additional: this allows one to match methods like toString(), finalize(),
wait(),
whatever, etc.. in say the default java.lang.Object class without having to
apply
annotations everywhere..
Original comment by AaronJWh...@gmail.com
on 14 Nov 2007 at 2:22
public class MethodCalledMatcher
extends AbstractMatcher<Method>
{
public static Matcher<Method> methodCalled(String methodName)
{
return new MethodCalledMatcher(methodName);
}
private String methodName;
public MethodCalledMatcher(String methodName)
{
Objects.nonNull(methodName, "method name");
this.methodName = methodName;
}
@Override
public boolean matches(Method method) {
return method.getName().equals(methodName);
}
@Override
public String toString() {
return "methodCalled(" + methodName + ")";
}
}
Original comment by AaronJWh...@gmail.com
on 19 Nov 2007 at 4:40
Anyone interested in this can use the code above. We won't add this
functionality to core Guice for the reasons
crazybob describes here:
http://groups.google.com/group/google-guice/browse_frm/thread/1330ed84618d57b4/c
40843d874a4833c?
#c40843d874a4833c
Original comment by limpbizkit
on 16 May 2008 at 4:31
Original issue reported on code.google.com by
AaronJWh...@gmail.com
on 14 Nov 2007 at 2:11