diff options
Diffstat (limited to 'sonar-plugin-api/src/main/java/org')
3 files changed, 20 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java index 59c1f66ed9a..b33487af40f 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java @@ -600,6 +600,7 @@ public final class CoreMetrics { // SCM + // These metrics are computed by the SCM Activity plugin, since version 1.2. public static final String SCM_COMMITS_KEY = "commits"; public static final Metric SCM_COMMITS = new Metric.Builder(SCM_COMMITS_KEY, Metric.ValueType.INT) diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java index 3b64b89da3f..6462db590d5 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java @@ -323,6 +323,14 @@ public class Measure { } /** + * @since 2.7 + */ + public Measure unsetData() { + this.data=null; + return this; + } + + /** * @return the description of the measure */ public String getDescription() { 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 92050c92d81..e0ec08d89aa 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 @@ -130,7 +130,9 @@ public class Metric implements ServerExtension, BatchExtension { * Creates a metric based on its key. Shortcut to Metric(key, ValueType.INT) * * @param key the metric key + * @deprecated since 2.7 use the Builder factory. */ + @Deprecated public Metric(String key) { this(key, ValueType.INT); } @@ -141,11 +143,17 @@ public class Metric implements ServerExtension, BatchExtension { * * @param key the key * @param type the type + * @deprecated since 2.7 use the Builder factory. */ + @Deprecated public Metric(String key, ValueType type) { this(key, key, key, type, -1, Boolean.FALSE, null, false); } + /** + * @deprecated since 2.7 use the Builder factory. + */ + @Deprecated public Metric(String key, String name, String description, ValueType type, Integer direction, Boolean qualitative, String domain) { this(key, name, description, type, direction, qualitative, domain, false); } @@ -164,6 +172,7 @@ public class Metric implements ServerExtension, BatchExtension { * @param qualitative whether the metric is qualitative * @param domain the metric domain * @param userManaged whether the metric is user managed + * @deprecated since 2.7 use the Builder factory. */ @Deprecated public Metric(String key, String name, String description, ValueType type, Integer direction, Boolean qualitative, String domain, boolean userManaged) { @@ -197,7 +206,9 @@ public class Metric implements ServerExtension, BatchExtension { * @param qualitative whether the metric is qualitative * @param domain the metric domain * @param formula the metric formula + * @deprecated since 2.7 use the Builder factory. */ + @Deprecated public Metric(String key, String name, ValueType type, Integer direction, Boolean qualitative, String domain, Formula formula) { this.key = key; this.name = name; |