From 804d3141d8dee14082a9a10b75ad191e386c5576 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 16 Aug 2011 18:49:05 +0200 Subject: SONAR-2655 define toString() on all the hibernate models --- .../src/main/java/org/sonar/api/security/GroupRole.java | 7 +++++++ .../src/main/java/org/sonar/api/security/UserRole.java | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'sonar-plugin-api/src/main/java/org/sonar/api/security') 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(); + } } -- cgit v1.2.3