]> source.dussan.org Git - sonarqube.git/commitdiff
small update of ActiveRule*Dtos.
authorStephane Gamard <stephane.gamard@searchbox.com>
Sat, 10 May 2014 11:59:07 +0000 (13:59 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Sat, 10 May 2014 11:59:07 +0000 (13:59 +0200)
sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleDto.java
sonar-core/src/main/java/org/sonar/core/qualityprofile/db/ActiveRuleParamDto.java

index fe3a586c76d72cba1f16271fbbe14090a3f8e497..a48272135e7b9795b449d815893e4f4b45d8dc2b 100644 (file)
@@ -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();
+  }
+
+
 }
index 40d583ea26c3709d48bb0af2398ee38d1f752f82..f9e504984a7cb9556c9d37449781b3481790a59b 100644 (file)
@@ -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());
   }
 }