diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-06-12 14:35:01 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-06-12 14:35:10 +0200 |
commit | 4af44075e1b04fbaa08f3cf43d9f34e0f34473b1 (patch) | |
tree | 9d93c270d54e18141ce608d4fc6aa3eee6be51ce /sonar-plugin-api | |
parent | 1eff1404e84fa846048114107f37a51856ea1ca2 (diff) | |
download | sonarqube-4af44075e1b04fbaa08f3cf43d9f34e0f34473b1.tar.gz sonarqube-4af44075e1b04fbaa08f3cf43d9f34e0f34473b1.zip |
SONAR-5369 Rename DB column RULES.CARDINALITY to RULES.IS_TEMPLATE
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java | 33 |
1 files changed, 28 insertions, 5 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 a8592b81a22..63cb14defff 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 @@ -107,8 +107,8 @@ public class Rule { private String pluginName; @Enumerated(EnumType.STRING) - @Column(name = "cardinality", updatable = true, nullable = false) - private Cardinality cardinality = Cardinality.SINGLE; + @Column(name = "is_template", updatable = true, nullable = false) + private boolean isTemplate = false; @Column(name = "status", updatable = true, nullable = true) private String status = STATUS_READY; @@ -351,12 +351,35 @@ public class Rule { return setRepositoryKey(repositoryKey).setKey(key).setConfigKey(key); } + /** + * @since 4.4 + */ + public boolean isTemplate() { + return isTemplate; + } + + /** + * @since 4.4 + */ + public Rule setIsTemplate(boolean isTemplate) { + this.isTemplate = isTemplate; + return this; + } + + /** + * @deprecated since 4.4, use {@link #isTemplate()} + */ + @Deprecated public Cardinality getCardinality() { - return cardinality; + return isTemplate ? Cardinality.MULTIPLE : Cardinality.SINGLE; } + /** + * @deprecated since 4.4, use {@link #setIsTemplate(boolean)} + */ + @Deprecated public Rule setCardinality(Cardinality c) { - this.cardinality = c; + this.isTemplate = Cardinality.MULTIPLE.equals(c); return this; } @@ -544,7 +567,7 @@ public class Rule { .append("configKey", configKey) .append("plugin", pluginName) .append("severity", priority) - .append("cardinality", cardinality) + .append("isTemplate", isTemplate()) .append("status", status) .append("language", language) .append("template", template) |