@Override
    public void accept(Class aClass) {
        aClass.add(Constructor.newPublic()
            .call(constr -> aClass.getFields().stream()
                .filter(f -> f.getModifiers().contains(FINAL))
                .map(Field::copy)
                .forEachOrdered(f -> {
                    f.getModifiers().clear();
                    f.final_();
                    constr.add(f).imports(Objects.class, "requireNonNull");
                    if (isPrimitive(f.getType())) {
                        constr.add(format("this.%1$s = %1$s;", f.getName()));
                    } else {
                        constr.add(format("this.%1$s = requireNonNull(%1$s);", f.getName()));
                    }
                })
            )
        );
    }
Generates a public constructor with all the final fields as input
parameters.

@author Emil Forslund
@since  2.5
common-parent/codegen/src/main/java/com/speedment/common/codegen/controller/AutoConstructor.java