diff options
author | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-05-13 21:02:48 +0200 |
---|---|---|
committer | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-05-13 21:02:48 +0200 |
commit | 2f4cd7324e5886f0cbeeb1ba95c47e53a5b38772 (patch) | |
tree | 4bbbedceedbaab53aeca91b8500f61a8a4884942 /sonar-core | |
parent | b5fa6bb06820b19e86b5e664d697aac3191ae3a9 (diff) | |
download | sonarqube-2f4cd7324e5886f0cbeeb1ba95c47e53a5b38772.tar.gz sonarqube-2f4cd7324e5886f0cbeeb1ba95c47e53a5b38772.zip |
Updated QualityProfile package to DAOv2 (partialy)
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleKey.java | 1 | ||||
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java | 23 |
2 files changed, 22 insertions, 2 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleKey.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleKey.java index 5d1f3ffe4b5..f6d7a1483f4 100644 --- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleKey.java +++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleKey.java @@ -25,7 +25,6 @@ import org.sonar.api.rule.RuleKey; import java.io.Serializable; /** - * Created by gamars on 05/05/14. * * @since 4.4 */ diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java index a11494c6ff0..643c9762abb 100644 --- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java +++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/QualityProfileDto.java @@ -20,10 +20,12 @@ package org.sonar.core.qualityprofile.db; +import org.sonar.core.db.Dto; + import javax.annotation.CheckForNull; import javax.annotation.Nullable; -public class QualityProfileDto { +public class QualityProfileDto extends Dto<QualityProfileKey> { private Integer id; private String name; @@ -32,6 +34,19 @@ public class QualityProfileDto { private Integer version; private boolean used; + /** + * @deprecated use QualityProfileDto.createFor instead + */ + @Deprecated + public QualityProfileDto(){ + + } + + @Override + public QualityProfileKey getKey() { + return QualityProfileKey.of(this.getName(), this.getLanguage()); + } + public Integer getId() { return id; } @@ -86,4 +101,10 @@ public class QualityProfileDto { this.used = used; return this; } + + public static QualityProfileDto createFor(String name, String language){ + return new QualityProfileDto() + .setName(name) + .setLanguage(language); + } } |