public Map<String, FieldDescription> fields() {
        if (isFrozen()) return fields;
        if (inherited().size() == 0) return Collections.unmodifiableMap(fields);

        // Collapse inherited
        Map<String, FieldDescription> allFields = new LinkedHashMap<>();
        for (QueryProfileType inheritedType : inherited)
            allFields.putAll(inheritedType.fields());
        allFields.putAll(fields);
        return Collections.unmodifiableMap(allFields);
    }
Returns all the fields of this profile type and all types it inherits as a read-only map
container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java