From: Julien Lancelot Date: Thu, 28 Aug 2014 07:19:13 +0000 (+0200) Subject: Add helper to filter measures by rule key X-Git-Tag: 4.5-RC1~62 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=680432430d4506eae029e9e3b61c123ee98be10d;p=sonarqube.git Add helper to filter measures by rule key --- diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java index 15812bbafe9..ef79ca10051 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java @@ -153,8 +153,12 @@ public final class MeasuresFilters { }; } + public static MeasuresFilter rule(final Metric metric, final RuleKey ruleKey) { + return new RuleFilter(metric, ruleKey); + } + public static MeasuresFilter rule(final Metric metric, final Rule rule) { - return new RuleFilter(metric, rule.ruleKey()); + return rule(metric, rule.ruleKey()); } public static MeasuresFilter> rules(final Metric metric) {