class ComponentHashPolicyEvaluator extends AbstractPolicyEvaluator {

    private static final Logger LOGGER = Logger.getLogger(ComponentHashPolicyEvaluator.class);

    /**
     * {@inheritDoc}
     */
    @Override
    public PolicyCondition.Subject supportedSubject() {
        return PolicyCondition.Subject.COMPONENT_HASH;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public List<PolicyConditionViolation> evaluate(final Policy policy, final Component component) {
        final List<PolicyConditionViolation> violations = new ArrayList<>();
        for (final PolicyCondition condition : super.extractSupportedConditions(policy)) {
            LOGGER.debug("Evaluating component (" + component.getUuid() + ") against policy condition (" + condition.getUuid() + ")");
            final Hash hash = extractHashValues(condition);
            if (matches(hash, component)) {
                violations.add(new PolicyConditionViolation(condition, component));
            }
        }
        return violations;
    }

    private Hash extractHashValues(PolicyCondition condition) {

        if (condition.getValue() == null) {
            return null;
        }
        final JSONObject def = new JSONObject(condition.getValue());
        return new Hash(
                def.optString("algorithm", null),
                def.optString("value", null)
        );
    }

    private boolean matches(Hash hash, Component component) {<FILL_FUNCTION_BODY>}

}


        if (hash != null && hash.getAlgorithm() != null && hash.getValue() != null) {
            String value = StringUtils.trimToNull(hash.getValue());
            if (Hash.Algorithm.MD5.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getMd5());
            } else if (Hash.Algorithm.SHA1.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getSha1());
            } else if (Hash.Algorithm.SHA_256.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getSha256());
            } else if (Hash.Algorithm.SHA_384.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getSha384());
            } else if (Hash.Algorithm.SHA_512.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getSha512());
            } else if (Hash.Algorithm.SHA3_256.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getSha3_256());
            } else if (Hash.Algorithm.SHA3_384.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getSha3_384());
            } else if (Hash.Algorithm.SHA3_512.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getSha3_512());
            } else if (Hash.Algorithm.BLAKE3.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getBlake3());
            } else if (Hash.Algorithm.BLAKE2b_256.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getBlake2b_256());
            } else if (Hash.Algorithm.BLAKE2b_384.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getBlake2b_384());
            } else if (Hash.Algorithm.BLAKE2b_512.getSpec().equalsIgnoreCase(hash.getAlgorithm())) {
                return value.equalsIgnoreCase(component.getBlake2b_512());
            }
        }
        return false;
    
<methods>public non-sealed void <init>() ,public void setQueryManager(org.dependencytrack.persistence.QueryManager) <variables>protected org.dependencytrack.persistence.QueryManager qm