aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-08-01 17:27:07 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-08-01 17:27:48 +0200
commit3e87a7151696d1a4aaa85ce314b74d5cc62f1309 (patch)
tree6b4cfe07b2d4345386bdedf0740dfa890ea6097f /sonar-plugin-api
parentc8c4752cf3f27fb4b0acf1234208127934689568 (diff)
downloadsonarqube-3e87a7151696d1a4aaa85ce314b74d5cc62f1309.tar.gz
sonarqube-3e87a7151696d1a4aaa85ce314b74d5cc62f1309.zip
SONAR-75 Remove unused French GWT properties + add method Metric.Builder#setUserManaged(boolean)
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java24
1 files changed, 22 insertions, 2 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
index dc27e6fe46e..4ecd5ab5eac 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
@@ -230,7 +230,7 @@ public class Metric implements ServerExtension, BatchExtension {
}
private Metric(String key, String name, ValueType type, String description, Integer direction, String domain, Boolean qualitative, Double worstValue, Double bestValue,
- Boolean optimizedBestValue, Boolean hidden, Formula formula) {
+ Boolean optimizedBestValue, Boolean hidden, Formula formula, boolean userManaged) {
this.key = key;
this.name = name;
this.description = description;
@@ -245,6 +245,7 @@ public class Metric implements ServerExtension, BatchExtension {
this.bestValue = bestValue;
this.hidden = hidden;
this.formula = formula;
+ this.userManaged = userManaged;
}
/**
@@ -601,6 +602,7 @@ public class Metric implements ServerExtension, BatchExtension {
private Double bestValue;
private boolean optimizedBestValue = false;
private boolean hidden = false;
+ private boolean userManaged = false;
/**
* @param key the metric key, should be unique among all metrics
@@ -692,12 +694,30 @@ public class Metric implements ServerExtension, BatchExtension {
return this;
}
+ /**
+ * Values of user-managed metrics can be set online in the "Manual measures" page.
+ * @since 2.10
+ */
+ public boolean isUserManaged() {
+ return userManaged;
+ }
+
+ /**
+ * Values of user-managed metrics can be set online in the "Manual measures" page.
+ *
+ * @since 2.10
+ */
+ public Builder setUserManaged(boolean b) {
+ this.userManaged = b;
+ return this;
+ }
+
public Metric create() {
if (ValueType.PERCENT.equals(this.type)) {
this.bestValue = (direction == DIRECTION_BETTER ? 100.0 : 0.0);
this.worstValue = (direction == DIRECTION_BETTER ? 0.0 : 100.0);
}
- return new Metric(key, name, type, description, direction, domain, qualitative, worstValue, bestValue, optimizedBestValue, hidden, formula);
+ return new Metric(key, name, type, description, direction, domain, qualitative, worstValue, bestValue, optimizedBestValue, hidden, formula, userManaged);
}
}
}