aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-08-21 16:51:35 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-08-22 10:01:35 +0200
commit90864dacb4972d0251c5659d4cb962fbd919b032 (patch)
tree9f4fbb1636efbd665d47e4cfac01af0ef341a6fd /sonar-core
parent3b3dcf593ca1dfac3fa81b331745bcb0da23e756 (diff)
downloadsonarqube-90864dacb4972d0251c5659d4cb962fbd919b032.tar.gz
sonarqube-90864dacb4972d0251c5659d4cb962fbd919b032.zip
SONAR-5530 - IssueDto extends Dto<String>
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java29
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/Dto.java6
2 files changed, 17 insertions, 18 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java
index be0d275f1cd..858a1b7c8ff 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueDto.java
@@ -27,17 +27,18 @@ import org.sonar.api.issue.internal.DefaultIssue;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.Duration;
import org.sonar.api.utils.KeyValueFormat;
+import org.sonar.core.persistence.Dto;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-
import java.io.Serializable;
import java.util.Date;
/**
* @since 3.6
*/
-public final class IssueDto implements Serializable {
+public final class IssueDto extends Dto<String> implements Serializable {
+
private Long id;
private String kee;
@@ -64,10 +65,6 @@ public final class IssueDto implements Serializable {
private Date issueUpdateDate;
private Date issueCloseDate;
- // technical dates
- private Date createdAt;
- private Date updatedAt;
-
/**
* Temporary date used only during scan
*/
@@ -79,6 +76,12 @@ public final class IssueDto implements Serializable {
private String componentKey;
private String rootComponentKey;
+
+ @Override
+ public String getKey() {
+ return kee;
+ }
+
public Long getId() {
return id;
}
@@ -261,21 +264,15 @@ public final class IssueDto implements Serializable {
return this;
}
- public Date getCreatedAt() {
- return createdAt;
- }
-
+ @Override
public IssueDto setCreatedAt(Date createdAt) {
- this.createdAt = createdAt;
+ super.setCreatedAt(createdAt);
return this;
}
- public Date getUpdatedAt() {
- return updatedAt;
- }
-
+ @Override
public IssueDto setUpdatedAt(@Nullable Date updatedAt) {
- this.updatedAt = updatedAt;
+ super.setUpdatedAt(updatedAt);
return this;
}
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java b/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java
index 891ebcd595c..e5cfec6109b 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/Dto.java
@@ -29,12 +29,14 @@ public abstract class Dto<K extends Serializable> {
public abstract K getKey();
- public final void setCreatedAt(Date datetime) {
+ public Dto setCreatedAt(Date datetime) {
this.createdAt = datetime;
+ return this;
}
- public final void setUpdatedAt(Date datetime) {
+ public Dto setUpdatedAt(Date datetime) {
this.updatedAt = datetime;
+ return this;
}
public final Date getCreatedAt() {