aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-06-30 14:05:55 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-06-30 14:46:44 +0200
commit9304b6793392c339528e5730b345cc49bca9ca09 (patch)
tree39a52ff03e71645822c4b7351835f0bfc7508e6c /sonar-plugin-api
parent30033ad9966b4e84e969db0815887d012bfea6eb (diff)
downloadsonarqube-9304b6793392c339528e5730b345cc49bca9ca09.tar.gz
sonarqube-9304b6793392c339528e5730b345cc49bca9ca09.zip
SONAR-5007 - Added char and subChar to api.Rule bean for Issue WS
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java97
1 files changed, 95 insertions, 2 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 63cb14defff..b783ac11844 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
@@ -34,8 +34,20 @@ import org.sonar.check.Cardinality;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-import javax.persistence.*;
-
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -138,6 +150,15 @@ public class Rule {
@Column(name = "updated_at", updatable = true, nullable = true)
private Date updatedAt;
+ @Transient
+ private String defaultCharacteristic;
+ @Transient
+ private String defaultSubCharacteristic;
+ @Transient
+ private String characteristic;
+ @Transient
+ private String subCharacteristic;
+
private transient String[] tags = DEFAULT_TAGS;
/**
@@ -497,9 +518,11 @@ public class Rule {
/**
* For internal use only.
*
+ * @deprecated since 4.4, use {@link #getCharacteristic()}
* @since 4.3
*/
@CheckForNull
+ @Deprecated
public Integer getCharacteristicId() {
return characteristicId;
}
@@ -507,8 +530,10 @@ public class Rule {
/**
* For internal use only.
*
+ * @deprecated since 4.4, use {@link #setCharacteristic(@Nullable String characteristic)}
* @since 4.3
*/
+ @Deprecated
public Rule setCharacteristicId(@Nullable Integer characteristicId) {
this.characteristicId = characteristicId;
return this;
@@ -517,9 +542,11 @@ public class Rule {
/**
* For internal use only.
*
+ * @deprecated since 4.4, use {@link #getDefaultCharacteristic()}
* @since 4.3
*/
@CheckForNull
+ @Deprecated
public Integer getDefaultCharacteristicId() {
return defaultCharacteristicId;
}
@@ -527,8 +554,10 @@ public class Rule {
/**
* For internal use only.
*
+ * @deprecated since 4.4, use {@link #setDefaultCharacteristic(@Nullable String defaultCharacteristic)}
* @since 4.3
*/
+ @Deprecated
public Rule setDefaultCharacteristicId(@Nullable Integer defaultCharacteristicId) {
this.defaultCharacteristicId = defaultCharacteristicId;
return this;
@@ -609,4 +638,68 @@ public class Rule {
public RuleKey ruleKey() {
return RuleKey.of(getRepositoryKey(), getKey());
}
+
+ /**
+ * @since 4.4
+ */
+ @CheckForNull
+ public String getDefaultCharacteristic() {
+ return defaultCharacteristic;
+ }
+
+ /**
+ * @since 4.4
+ */
+ public Rule setDefaultCharacteristic(@Nullable String defaultCharacteristic) {
+ this.defaultCharacteristic = defaultCharacteristic;
+ return this;
+ }
+
+ /**
+ * @since 4.4
+ */
+ @CheckForNull
+ public String getDefaultSubCharacteristic() {
+ return defaultSubCharacteristic;
+ }
+
+ /**
+ * @since 4.4
+ */
+ public Rule setDefaultSubCharacteristic(@Nullable String defaultSubCharacteristic) {
+ this.defaultSubCharacteristic = defaultSubCharacteristic;
+ return this;
+ }
+
+ /**
+ * @since 4.4
+ */
+ @CheckForNull
+ public String getCharacteristic() {
+ return characteristic;
+ }
+
+ /**
+ * @since 4.4
+ */
+ public Rule setCharacteristic(@Nullable String characteristic) {
+ this.characteristic = characteristic;
+ return this;
+ }
+
+ /**
+ * @since 4.4
+ */
+ @CheckForNull
+ public String getSubCharacteristic() {
+ return subCharacteristic;
+ }
+
+ /**
+ * @since 4.4
+ */
+ public Rule setSubCharacteristic(@Nullable String subCharacteristic) {
+ this.subCharacteristic = subCharacteristic;
+ return this;
+ }
}