public FlagData partialResolve(FetchVector fetchVector) {
        // Note:  As a result of partialResolve, there could be e.g. two identical rules, and the latter will always be ignored by resolve().
        // Consider deduping.  Deduping is actually not specific to partialResolve and could be done e.g. at construction time.

        List<Rule> newRules = new ArrayList<>();
        for (var rule : rules) {
            Optional<Rule> partialRule = rule.partialResolve(fetchVector);
            if (partialRule.isPresent()) {
                newRules.add(partialRule.get());
                if (partialRule.get().conditions().isEmpty()) {
                    // Any following rule will always be ignored during resolution.
                    break;
                }
            }
        }
        newRules = optimizeRules(newRules);

        FetchVector newDefaultFetchVector = defaultFetchVector.without(fetchVector.dimensions());

        return new FlagData(id, newDefaultFetchVector, newRules);
    }
A data structure containing all data for a single flag, that can be serialized to/from JSON,
and that can be used to implement {@link FlagSource}.

@author hakonhall
flags/src/main/java/com/yahoo/vespa/flags/json/FlagData.java