aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-05-10 13:59:07 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-05-10 13:59:07 +0200
commit860e124315c1ef028cb627eb32a0d4f707a90804 (patch)
treeebc00309d9f998aaa44981e45a0ffd62455c759b /sonar-core
parent7726e32bce9c456e53533149f8be5e4727ad854c (diff)
downloadsonarqube-860e124315c1ef028cb627eb32a0d4f707a90804.tar.gz
sonarqube-860e124315c1ef028cb627eb32a0d4f707a90804.zip
small update of ActiveRule*Dtos.
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java9
-rw-r--r--sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleParamDto.java15
2 files changed, 18 insertions, 6 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java
index fe3a586c76d..a48272135e7 100644
--- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java
@@ -20,8 +20,9 @@
package org.sonar.core.qualityprofile.db;
-import com.google.common.base.Preconditions;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.core.db.Dto;
import org.sonar.core.rule.RuleDto;
import org.sonar.core.rule.SeverityUtil;
@@ -185,4 +186,10 @@ public class ActiveRuleDto implements Dto<ActiveRuleKey> {
return dto;
}
+ @Override
+ public String toString() {
+ return new ReflectionToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
+ }
+
+
}
diff --git a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleParamDto.java b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleParamDto.java
index 40d583ea26c..f9e504984a7 100644
--- a/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleParamDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleParamDto.java
@@ -76,10 +76,15 @@ public class ActiveRuleParamDto {
return this;
}
- public static ActiveRuleParamDto createFor(RuleParamDto minParam) {
- ActiveRuleParamDto dto = new ActiveRuleParamDto();
- dto.setKey(minParam.getName());
- dto.setRulesParameterId(minParam.getId());
- return dto;
+ public static ActiveRuleParamDto createFor(RuleParamDto param) {
+ return new ActiveRuleParamDto()
+ .setKey(param.getName())
+ .setRulesParameterId(param.getId());
+ }
+
+ public static ActiveRuleParamDto createFrom(ActiveRuleParamDto parentParam) {
+ return new ActiveRuleParamDto()
+ .setKey(parentParam.getKey())
+ .setRulesParameterId(parentParam.getId());
}
}