List<Filter> buildQuickLinkFilters(@Nullable Object filtersRaw) throws ClassCastException, IllegalArgumentException {
    if (null == filtersRaw) {
      return ImmutableList.of();
    }
    List<Filter> filters  = new ArrayList<>();
    for (Map<String, String> filterAsMap: (Collection<Map<String, String>>)filtersRaw) {
      Set<String> invalidAttributes = Sets.difference(filterAsMap.keySet(), ALLOWED_FILTER_ATTRIBUTES);

      Preconditions.checkArgument(invalidAttributes.isEmpty(),
          "%s%s",
          QuickLinksFilterDeserializer.PARSE_ERROR_MESSAGE_INVALID_JSON_TAG,
          invalidAttributes);

      String linkName = filterAsMap.get(LINK_NAME);
      String linkUrl = filterAsMap.get(LINK_URL);
      String attributeName = filterAsMap.get(LINK_ATTRIBUTE);
      boolean visible = Boolean.parseBoolean(filterAsMap.get(VISIBLE));

      Preconditions.checkArgument(null == linkName || null == attributeName,
         "%s link_name: %s, link_attribute: %s",
          QuickLinksFilterDeserializer.PARSE_ERROR_MESSAGE_AMBIGUOUS_FILTER,
          linkName,
          attributeName);

      Preconditions.checkArgument(null == linkUrl || null != linkName,
        "Invalid filter. Link url can only be applied to link name filters. link_url: %s",
        linkUrl);

      if (null != linkName) {
        filters.add(Filter.linkNameFilter(linkName, linkUrl, visible));
      }
      else if (null != attributeName) {
        filters.add(Filter.linkAttributeFilter(attributeName, visible));
      }
      else {
        filters.add(Filter.acceptAllFilter(visible));
      }
    }
    return filters;
  }
@param globalFiltersRaw The data in the request belonging to the "quicklinks_profile/filters" key.
@param serviceFiltersRaw The data in the request belonging to "quicklinks_profile/services"
@return The quicklinks profile as Json encoded string.
@throws QuickLinksProfileEvaluationException when the received data defines an invalid profile. This can be of various
   reasons: the received data is has invalid structure, critical data is missing or there are contradicting filter
   rules in the profile
ambari-server/src/main/java/org/apache/ambari/server/state/quicklinksprofile/QuickLinksProfileBuilder.java