private static boolean matchMandatory()

in repository/service/src/main/java/org/apache/karaf/cave/repository/service/bundlerepository/CapabilitySet.java [254:276]


    private static boolean matchMandatory(Capability cap, SimpleFilter sf) {
        if (cap instanceof CapabilityImpl) {
            for (Entry<String, Object> entry : cap.getAttributes().entrySet()) {
                if (((CapabilityImpl) cap).isAttributeMandatory(entry.getKey())
                        && !matchMandatoryAttribute(entry.getKey(), sf)) {
                    return false;
                }
            }
        } else {
            String value = cap.getDirectives().get(Constants.MANDATORY_DIRECTIVE);
            if (value != null) {
                List<String> names = ResourceBuilder.parseDelimitedString(value, ",");
                for (Entry<String, Object> entry : cap.getAttributes().entrySet()) {
                    if (names.contains(entry.getKey())
                            && !matchMandatoryAttribute(entry.getKey(), sf)) {
                        return false;
                    }
                }
            }

        }
        return true;
    }