@Override public boolean matches(Method method, Class<?> targetClass) { for (String mappedName : this.mappedNames) { if (mappedName.equals(method.getName()) || isMatch(method.getName(), mappedName)) { return true; } } return false; }
@Test public void testMatchingOnly() { // Can't do exact matching through isMatch assertTrue(pc.isMatch("echo", "ech*")); assertTrue(pc.isMatch("setName", "setN*")); assertTrue(pc.isMatch("setName", "set*")); assertFalse(pc.isMatch("getName", "set*")); assertFalse(pc.isMatch("setName", "set")); assertTrue(pc.isMatch("testing", "*ing")); }
@Override public boolean matches(Method method, Class<?> targetClass) { for (String mappedName : this.mappedNames) { if (mappedName.equals(method.getName()) || isMatch(method.getName(), mappedName)) { return true; } } return false; }
@Override public boolean matches(Method method, Class<?> targetClass) { for (String mappedName : this.mappedNames) { if (mappedName.equals(method.getName()) || isMatch(method.getName(), mappedName)) { return true; } } return false; }
public boolean matches(Method method, Class targetClass) { for (int i = 0; i < this.mappedNames.size(); i++) { String mappedName = (String) this.mappedNames.get(i); if (mappedName.equals(method.getName()) || isMatch(method.getName(), mappedName)) { return true; } } return false; }