From 680432430d4506eae029e9e3b61c123ee98be10d Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 28 Aug 2014 09:19:13 +0200 Subject: [PATCH] Add helper to filter measures by rule key --- .../main/java/org/sonar/api/measures/MeasuresFilters.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.39.5