@Override
    public Object convertFrom(Object object, QueryProfileRegistry registry) {
        QueryProfile profile;
        if (object instanceof String) {
            // A query profile type which itself can contain a value
            if (type != null && type.fields().containsKey("") && type.fields().get("").getType() == FieldType.stringType)
                return object;

            profile = registry.getComponent((String) object);
        }
        else if (object instanceof QueryProfile) {
            profile = (QueryProfile) object;
        }
        else {
            return null;
        }

        // Verify its type as well
        if (type != null && type != profile.getType()) return null;
        return profile;
    }
Returns the query profile type of this, or null if any type works
container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileFieldType.java