private static void exportEquals(String className, Collection<Field> fieldSet, Writer out, int ind) throws IOException {
        out.write(ind(ind)+"@Override public boolean equals(Object o) {\n");
        out.write(ind(ind+1)+"if (!(o instanceof "+className+")) return false;\n");
        out.write(ind(ind+1)+className+" other = ("+className+")o;\n");
        for (Field field: fieldSet) {
            out.write(ind(ind+1)+"if ("+getter(field.getName())+"()==null) { if (other."+getter(field.getName())+"()!=null) return false; }\n");
            out.write(ind(ind+2)+"else if (!("+getter(field.getName())+"().equals(other."+getter(field.getName())+"()))) return false;\n");
        }
        out.write(ind(ind+1)+"return true;\n");
        out.write(ind(ind)+"}\n\n");
    }
Exports the necessary overridden methods from Document/StructuredFieldValue
vespa-documentgen-plugin/src/main/java/com/yahoo/vespa/DocumentGenMojo.java