diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-08-28 11:04:46 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-08-31 09:52:02 +0200 |
commit | 824a30f8c36e35b3b9ca396619e3204f7568115b (patch) | |
tree | a3cb6573193333329498463ab74ebfb8878f8e90 /sonar-plugin-api/src | |
parent | 48835a873353be8fdd48ca57313f6a74ddaf15f7 (diff) | |
download | sonarqube-824a30f8c36e35b3b9ca396619e3204f7568115b.tar.gz sonarqube-824a30f8c36e35b3b9ca396619e3204f7568115b.zip |
SONAR-6730 Add component key in the API
It will allow to have more information in error generated by plugin or in debug logs.
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/Component.java | 2 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/test/ce/measure/ComponentImpl.java | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/Component.java b/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/Component.java index bd8746a5fd2..ede0cce0b21 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/Component.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/ce/measure/Component.java @@ -30,6 +30,8 @@ public interface Component { Type getType(); + String getKey(); + /** * The attributes of the Component if it's type is File. * diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/test/ce/measure/ComponentImpl.java b/sonar-plugin-api/src/test/java/org/sonar/api/test/ce/measure/ComponentImpl.java index ca2936def4f..b8fef1332bc 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/test/ce/measure/ComponentImpl.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/test/ce/measure/ComponentImpl.java @@ -60,6 +60,11 @@ public class ComponentImpl implements Component { } @Override + public String getKey() { + return key; + } + + @Override public FileAttributes getFileAttributes() { checkState(this.type == Component.Type.FILE, "Only component of type FILE have a FileAttributes object"); return fileAttributes; |