summaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2020-04-27 12:42:10 -0500
committersonartech <sonartech@sonarsource.com>2020-05-25 20:05:20 +0000
commit6b41a01454b98c413889dc2400a9cddb3b390847 (patch)
tree6ccca99e10d77b453abc252835d6c70cfdb41d6c /sonar-plugin-api
parent65e12a8ca01341c1ad00809d807bb8db0f5bf4b2 (diff)
downloadsonarqube-6b41a01454b98c413889dc2400a9cddb3b390847.tar.gz
sonarqube-6b41a01454b98c413889dc2400a9cddb3b390847.zip
SONAR-13221 Metrics
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java10
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java2
3 files changed, 7 insertions, 7 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 74802ebd14e..2c06a92a67d 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
@@ -129,7 +129,7 @@ public class Metric<G extends Serializable> implements Serializable, org.sonar.a
}
}
- private Integer id;
+ private String uuid;
private String key;
private String description;
private ValueType type;
@@ -239,15 +239,15 @@ public class Metric<G extends Serializable> implements Serializable, org.sonar.a
/**
* For internal use only
*/
- public Integer getId() {
- return id;
+ public String getUuid() {
+ return uuid;
}
/**
* For internal use only
*/
- public Metric<G> setId(@Nullable Integer id) {
- this.id = id;
+ public Metric<G> setUuid(@Nullable String uuid) {
+ this.uuid = uuid;
return this;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
index 978bd27f200..317eb35f578 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MetricFinder.java
@@ -37,7 +37,7 @@ import org.sonar.api.server.ServerSide;
public interface MetricFinder {
@CheckForNull
- Metric findById(int id);
+ Metric findByUuid(String uuid);
@CheckForNull
Metric findByKey(String key);
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java
index 2332571c60e..b4168483535 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java
@@ -51,7 +51,7 @@ public class MetricTest {
assertThat(metric.getWorstValue()).isNull();
assertThat(metric.getDirection()).isEqualTo(Metric.DIRECTION_NONE);
assertThat(metric.getEnabled()).isTrue();
- assertThat(metric.getId()).isNull();
+ assertThat(metric.getUuid()).isNull();
assertThat(metric.getUserManaged()).isFalse();
assertThat(metric.isHidden()).isFalse();
assertThat(metric.isOptimizedBestValue()).isFalse();