private void generateSetter(Class model, Type self, Field f) {
        final Method set = Method.of("set" + ucfirst(f.getName()), self)
            .set(Javadoc.of()
                .setText("Sets the " + f.getName() + OF_THIS + shortName(model.getName()) + ".")
                .add(JavadocTag.of("param", f.getName(), "the new value"))
                .add(JavadocTag.of(RETURN, "a reference to this object"))
            ).public_();

        if (isOptional(f.getType())) {
            // Optional is a parameterized type.
            final ParameterizedType paramType = (ParameterizedType) f.getType();

            set.add(Field.of(f.getName(), paramType.getActualTypeArguments()[0]))
                .add(THIS + "." + f.getName() + " = Optional.of(" + f.getName() + ");")
                .add(RETURN + " this;");
        } else {
            set.add(Field.of(f.getName(), f.getType()))
                .add(THIS + "." + f.getName() + " = " + f.getName() + ";")
                .add(RETURN + " " + THIS + ";");
        }

        if (onlyInclude.test(f, set)) {
            model.add(set);
        }
    }
Generates a setter for the field in the specified
class and sets the fields to private. Method signatures that has been
excluded in the construction of this control will be excluded from the
generation.
<p>
For fields of type {@link Optional}, the inner type will be used in the
setter parameter but the wrapped type will be used as output for the
getter.

@param model the model to generate for
@param self the type to generate for
@param f the field to generate for
common-parent/codegen/src/main/java/com/speedment/common/codegen/controller/SetGetAdd.java