- private String createSetterName(String aName) {
- return "set" + aName.substring(0, 1).toUpperCase() + aName.substring(1);
+ public SetterConfiguration remove(Method aMethod) {
+ if ( !aMethod.getDeclaringClass().isAssignableFrom(_class) ) {
+ throw new RuntimeException("Method " + aMethod + " not found in class " + _class + " or its superclasses");
+ }
+ for (Method method : setters.keySet()) {
+ if (method.equals(aMethod)) {
+ setters.remove(method);
+ return this;
+ }
+ }
+ throw new IllegalArgumentException(
+ "Method '" + aMethod + "' was not configured. ");