aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-12-07 16:17:50 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-12-07 16:17:50 +0000
commit0cd519b35d499f60fceec66f08dc7ca80301f127 (patch)
tree8c9a547da0ee1ce5c1bf20e9d139f1f705b42bec /sonar-ws-client
parentc1cfffea2098a53ab078deb9bebe47b627c389cf (diff)
downloadsonarqube-0cd519b35d499f60fceec66f08dc7ca80301f127.tar.gz
sonarqube-0cd519b35d499f60fceec66f08dc7ca80301f127.zip
SONAR-1937 add the field 'age' to violations web service + display the select box to filter violations by period
Diffstat (limited to 'sonar-ws-client')
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java13
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java1
2 files changed, 14 insertions, 0 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java
index ff0c3f22ce9..c984d15a3bf 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java
@@ -33,6 +33,7 @@ public class Violation extends Model {
private String resourceScope = null;
private String resourceQualifier = null;
private Date createdAt = null;
+ private Integer age = null;
public String getMessage() {
return message;
@@ -136,6 +137,18 @@ public class Violation extends Model {
/**
* @since 2.5
*/
+ public Integer getAge() {
+ return age;
+ }
+
+ public Violation setAge(Integer age) {
+ this.age = age;
+ return this;
+ }
+
+ /**
+ * @since 2.5
+ */
public Date getCreatedAt() {
return createdAt;
}
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java
index 258e5938570..c0c5aa538cc 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java
@@ -31,6 +31,7 @@ public class ViolationUnmarshaller extends AbstractUnmarshaller<Violation> {
violation.setLine(JsonUtils.getInteger(json, "line"));
violation.setSeverity(JsonUtils.getString(json, "priority"));
violation.setCreatedAt(JsonUtils.getDateTime(json, "createdAt"));
+ violation.setAge(JsonUtils.getInteger(json, "age"));
JSONObject rule = (JSONObject) json.get("rule");
if (rule != null) {