diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-07-28 10:14:43 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-07-28 10:14:51 +0200 |
commit | 5d4a6f543838403f26e9f18ee0ead44398ffec0f (patch) | |
tree | 5b45dd9d737a1a978f6975048d23283dbf59ad7b /sonar-plugin-api | |
parent | 831f128056cdd575e54d1635943833cebf898fb4 (diff) | |
download | sonarqube-5d4a6f543838403f26e9f18ee0ead44398ffec0f.tar.gz sonarqube-5d4a6f543838403f26e9f18ee0ead44398ffec0f.zip |
Add convenient factory methods ResourceQuery#create(String resourceKey) and Rule#create(String repo, String key)
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java index 29a3451d374..01cf4bb0952 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java @@ -426,4 +426,11 @@ public final class Rule { return new Rule().setUniqueKey(repositoryKey, key).setName(name); } + /** + * Create with all required fields + * @since 2.10 + */ + public static Rule create(String repositoryKey, String key) { + return new Rule().setUniqueKey(repositoryKey, key); + } } |