private void validateFilters() {
    Set<String> ids = new HashSet<String>();
    for (Filter filter : filters) {
      ids.add(filter.getId());
    }

    for(Metric metric : metrics) {
      if (metric.getFilter() != null && 
          !metric.getFilter().isEmpty() && 
          !ids.contains(metric.getFilter())) {
        throw new IllegalArgumentException(
            String.format("unrecognized filter id %s in metric %s",
                metric.getFilter(), metric.getId()));
      }
    }
  }
private void validateFilters ( ) { Set < String > ids = new HashSet < String > ( ) ; for ( Filter filter : filters ) { ids . add ( filter . getId ( ) ) ; } for ( Metric metric : metrics ) { if ( metric . getFilter ( ) != null && ! metric . getFilter ( ) . isEmpty ( ) && ! ids . contains ( metric . getFilter ( ) ) ) { throw new IllegalArgumentException ( String . format ( "unrecognized filter id %s in metric %s" , metric . getFilter ( ) , metric . getId ( ) ) ) ; } } }
Validates the filters, making sure each metric has a filter
@throws IllegalArgumentException if one or more parameters were invalid