class FilterEvaluator {

  Optional<Boolean> isVisible(Link quickLink) {
    // process first priority filters based on link name
    if (linkNameFilters.containsKey(quickLink.getName())) {
      return Optional.of(linkNameFilters.get(quickLink.getName()));
    }

    // process second priority filters based on link attributes
    // 'hide' rules take precedence over 'show' rules
    for (String attribute: DefaultQuickLinkVisibilityController.nullToEmptyList(quickLink.getAttributes())) {
      if (hideAttributes.contains(attribute)) return Optional.of(false);
    }
    for (String attribute: DefaultQuickLinkVisibilityController.nullToEmptyList(quickLink.getAttributes())) {
      if (showAttributes.contains(attribute)) return Optional.of(true);
    }

    // accept all filter (if exists) is the last priority
    return acceptAllFilter;
  }

    FilterEvaluator(List<Filter> filters);

}