private static String setBuilderValueFromConfig(CNode child, CNode node) {
        String name = child.getName();
        boolean isArray = child.isArray;
        boolean isMap = child.isMap;

        if (child instanceof FileLeaf && isArray) {
            return name + "(" + userDataType(child) + ".toValues(config." + name + "()));";
        } else if (child instanceof FileLeaf && isMap) {
            return name + "(" + userDataType(child) + ".toValueMap(config." + name + "()));";
        } else if (child instanceof FileLeaf) {
            return name + "(config." + name + "().value());";
        } else if (child instanceof PathLeaf && isArray) {
            return name + "(" + nodeClass(child) + ".toFileReferences(config." + name + "));";
        } else if (child instanceof PathLeaf && isMap) {
            return name + "(" + nodeClass(child) + ".toFileReferenceMap(config." + name + "));";
        } else if (child instanceof PathLeaf) {
            return name + "(config." + name + ".getFileReference());";
        } else if (child instanceof OptionalPathLeaf) {
            return name + "(config." + name + ".getFileReference());";
        } else if (child instanceof UrlLeaf && isArray) {
            return name + "(" + nodeClass(child) + ".toUrlReferences(config." + name + "));";
        } else if (child instanceof UrlLeaf && isMap) {
            return name + "(" + nodeClass(child) + ".toUrlReferenceMap(config." + name + "));";
        } else if (child instanceof UrlLeaf) {
            return name + "(config." + name + ".getUrlReference());";
        } else if (child instanceof ModelLeaf && isArray) {
            return name + "(" + nodeClass(child) + ".toModelReferences(config." + name + "));";
        } else if (child instanceof ModelLeaf && isMap) {
            return name + "(" + nodeClass(child) + ".toModelReferenceMap(config." + name + "));";
        } else if (child instanceof ModelLeaf) {
            return name + "(config." + name + ".getModelReference());";
        } else if (child instanceof LeafCNode) {
            return name + "(config." + name + "());";
        } else if (child instanceof InnerCNode && isArray) {
            return setInnerArrayBuildersFromConfig((InnerCNode) child, node);
        } else if (child instanceof InnerCNode && isMap) {
            return setInnerMapBuildersFromConfig((InnerCNode) child);
        } else {
            return name + "(new " + builderType(child) + "(config." + name + "()));";
        }
    }
\n" + //
                    " * Make a new builder and run the supplied function on it before using it as the value\n" + //
                    " * @param __func lambda that modifies the given builder\n" + //
                    " * @return this builder\n" + //
                    "
configgen/src/main/java/com/yahoo/config/codegen/BuilderGenerator.java