@Override
    public Collection<Field> getFields() {
        Collection<Field> collection = new LinkedList<>();

        for (DocumentType type : inherits) {
            collection.addAll(type.getFields());
        }

        collection.addAll(contentStructType.getFields());
        return List.copyOf(collection);
    }
All fields defined in the document and its parents
This is for internal use
Use {@link #fieldSet()} instead or {@link #fieldSetAll()} if you really want all fields
@return All fields defined in the document and its parents
document/src/main/java/com/yahoo/document/DocumentType.java