@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
  @Override public boolean test(Measurement measurement) {
    Id id = measurement.id();
    if (!stringMatches(id.name(), meterNamePattern)) {
        return false;
    }

    if (tagNamePattern != null || tagValuePattern != null) {
      for (Tag tag : id.tags()) {
        boolean nameOk = stringMatches(tag.key(), tagNamePattern);
        boolean valueOk = stringMatches(tag.value(), tagValuePattern);
        if (nameOk && valueOk) {
          return true;
        }
      }
      return false;
    }

    return true;
  }
@ SuppressWarnings ( "PMD.JUnit4TestShouldUseTestAnnotation" ) @ Override public boolean test ( Measurement measurement ) { Id id = measurement . id ( ) ; if ( ! stringMatches ( id . name ( ) , meterNamePattern ) ) { return false ; } if ( tagNamePattern != null || tagValuePattern != null ) { for ( Tag tag : id . tags ( ) ) { boolean nameOk = stringMatches ( tag . key ( ) , tagNamePattern ) ; boolean valueOk = stringMatches ( tag . value ( ) , tagValuePattern ) ; if ( nameOk && valueOk ) { return true ; } } return false ; } return true ; }
Implements MeasurementFilter interface.