diff options
Diffstat (limited to 'sonar-ws-client')
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java | 13 | ||||
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java | 1 |
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) { |