public void addFieldSets(Map<String, Collection<String>> fieldSets) {
        for (Map.Entry<String, Collection<String>> entry : fieldSets.entrySet()) {

            Set<Field> fields = new LinkedHashSet<>(entry.getValue().size());
            for (DocumentType parent : inherits) {
                Set<Field> parentFieldSet = parent.fieldSet(entry.getKey());
                if (parentFieldSet != null) {
                    fields.addAll(parentFieldSet);
                }
            }
            for (Field orderedField : getAllUniqueFields()) {
                if (entry.getValue().contains(orderedField.getName())) {
                    fields.add(orderedField);
                }
            }

            this.fieldSets.put(entry.getKey(), ImmutableSet.copyOf(fields));
        }
        if ( ! this.fieldSets.containsKey(AllFields.NAME)) {
            this.fieldSets.put(AllFields.NAME, getAllUniqueFields());
        }
    }
Adds an field that can be used with this document type.

@param field the field to add
document/src/main/java/com/yahoo/document/DocumentType.java