aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main/java/org/sonar/api/security
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-08-16 18:49:05 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-08-16 18:49:05 +0200
commit804d3141d8dee14082a9a10b75ad191e386c5576 (patch)
tree63964bd2f194fb7734c9de4e436720e044631aaf /sonar-plugin-api/src/main/java/org/sonar/api/security
parentffded94d51008c00351a231cc9b6b86201400dec (diff)
downloadsonarqube-804d3141d8dee14082a9a10b75ad191e386c5576.tar.gz
sonarqube-804d3141d8dee14082a9a10b75ad191e386c5576.zip
SONAR-2655 define toString() on all the hibernate models
Diffstat (limited to 'sonar-plugin-api/src/main/java/org/sonar/api/security')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/security/GroupRole.java7
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/security/UserRole.java7
2 files changed, 14 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/security/GroupRole.java b/sonar-plugin-api/src/main/java/org/sonar/api/security/GroupRole.java
index 0dce5bea884..d0cfb857dc8 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/security/GroupRole.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/security/GroupRole.java
@@ -19,6 +19,8 @@
*/
package org.sonar.api.security;
+import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.database.BaseIdentifiable;
import javax.persistence.Column;
@@ -81,4 +83,9 @@ public class GroupRole extends BaseIdentifiable {
public boolean isAnyone() {
return groupId==ANYONE_GROUP_ID;
}
+
+ @Override
+ public String toString() {
+ return new ReflectionToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
+ }
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/security/UserRole.java b/sonar-plugin-api/src/main/java/org/sonar/api/security/UserRole.java
index eb1a8a10598..7925e55513f 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/security/UserRole.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/security/UserRole.java
@@ -19,6 +19,8 @@
*/
package org.sonar.api.security;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.database.BaseIdentifiable;
import javax.persistence.Column;
@@ -78,4 +80,9 @@ public class UserRole extends BaseIdentifiable {
this.resourceId = resourceId;
return this;
}
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
+ }
}