From 2f2e9e04153a67fe669031c67e40351ca3cff8d1 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Fri, 3 Feb 2012 03:55:39 +0400 Subject: [PATCH] Improve RuleMeasure * Fluent API * RulePriority renamed into Severity --- .../org/sonar/api/measures/RuleMeasure.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java index 674ddd05545..923aea5f006 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java @@ -46,20 +46,33 @@ public class RuleMeasure extends Measure { return rule; } - public void setRule(Rule rule) { + public RuleMeasure setRule(Rule rule) { this.rule = rule; + return this; } public RulePriority getRulePriority() { return rulePriority; } - public void setRulePriority(RulePriority rulePriority) { + /** + * @deprecated since 2.14 use {@link #setSeverity()} instead. See SONAR-1829. + */ + public RuleMeasure setRulePriority(RulePriority rulePriority) { this.rulePriority = rulePriority; + return this; } /** - * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007 + * @since 2.14 + */ + public RuleMeasure setSeverity(RulePriority severity) { + this.rulePriority = severity; + return this; + } + + /** + * @deprecated since 2.5. See SONAR-2007. */ @Deprecated public Integer getRuleCategory() { @@ -67,11 +80,10 @@ public class RuleMeasure extends Measure { } /** - * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007 + * @deprecated since 2.5. See SONAR-2007. */ @Deprecated public void setRuleCategory(Integer ruleCategory) { - } @Override @@ -131,7 +143,7 @@ public class RuleMeasure extends Measure { } /** - * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007 + * @deprecated since 2.5. See SONAR-2007. */ @Deprecated public static RuleMeasure createForCategory(Metric metric, Integer category, Double value) { -- 2.39.5