+ * Name of a setter method.
+ *
+ * @return Reference to the current object to allow call chaining.
+ *
+ */
+ public SetterConfiguration add(final String aName) {
+ List<Method> methods = new ArrayList<Method>();
+ CollectionFilter.filter(getAllSetters(clazz, publicOnly), methods,
+ new Condition<Method>() {
+ @Override
+ public boolean matches(Method aObject) {
+ return aObject.getName().equals(aName);
+ }
+ });
+
+ if (methods.size() == 0) {
+ throw new IllegalArgumentException("Method '" + aName +
+ "' not found in " + clazz.getName());
+ }
+
+ // TODO is it possible to get more than one setter here in case the
+ // subclass overrides
+ // the baseclass method?
+ setters.put(methods.get(0), createParameterValues(methods.get(0)));
+
+ return this;
+ }
+
+ /**
+ * Adds a given setter identified by the type it accepts to the list of
+ * setters.N
+ *
+ * @param aType
+ * Type to look for. Note that this must be the exact type as
+ * autoboxing and autounboxing is not used.
+ *
+ * @return Reference to the current object to allow call chaining.
+ *
+ * @throws IllegalArgumentException
+ * In case no setter is found or multiple setters are found.