001: /******************************************************************************
002: * JBoss, a division of Red Hat *
003: * Copyright 2006, Red Hat Middleware, LLC, and individual *
004: * contributors as indicated by the @authors tag. See the *
005: * copyright.txt in the distribution for a full listing of *
006: * individual contributors. *
007: * *
008: * This is free software; you can redistribute it and/or modify it *
009: * under the terms of the GNU Lesser General Public License as *
010: * published by the Free Software Foundation; either version 2.1 of *
011: * the License, or (at your option) any later version. *
012: * *
013: * This software is distributed in the hope that it will be useful, *
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of *
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
016: * Lesser General Public License for more details. *
017: * *
018: * You should have received a copy of the GNU Lesser General Public *
019: * License along with this software; if not, write to the Free *
020: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
021: * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
022: ******************************************************************************/package org.jboss.portal.migration.model22.impl.role;
023:
024: import org.jboss.portal.migration.model22.model.Role;
025:
026: import java.util.HashSet;
027: import java.util.Set;
028:
029: /**
030: * @author <a href="mailto:julien@jboss.org">Julien Viet </a>
031: * @author <a href="mailto:theute@jboss.org">Thomas Heute </a>
032: * @author Roy Russo : roy at jboss dot org
033: * @version $Revision: 8784 $
034: */
035: public class Role22Impl implements Role {
036:
037: public Long key;
038: public String name;
039: public Set users;
040: public String displayName;
041:
042: /**
043: *
044: */
045: public Role22Impl() {
046: this .key = null;
047: this .name = null;
048: this .displayName = null;
049: this .users = new HashSet();
050: }
051:
052: /**
053: *
054: */
055: public Role22Impl(String name) {
056: this .key = null;
057: this .name = name;
058: this .displayName = name;
059: this .users = new HashSet();
060: }
061:
062: /**
063: *
064: */
065: public Role22Impl(String name, String displayName) {
066: this .key = null;
067: this .name = name;
068: this .displayName = displayName;
069: this .users = new HashSet();
070: }
071:
072: /**
073: * @hibernate.id column="jbp_rid" generator-class="native"
074: * <p/>
075: * Called by hibernate.
076: */
077: protected Long getKey() {
078: return key;
079: }
080:
081: /** Called by hibernate. */
082: protected void setKey(Long key) {
083: this .key = key;
084: }
085:
086: /** Called by hibernate. */
087: protected void setName(String name) {
088: this .name = name;
089: }
090:
091: /** Called by hibernate. */
092: protected void setUsers(Set users) {
093: this .users = users;
094: }
095:
096: // ******************************************************************************************************************
097:
098: public Object getId() {
099: return key;
100: }
101:
102: /**
103: *
104: */
105: public String getName() {
106: return name;
107: }
108:
109: /**
110: *
111: */
112: public String getDisplayName() {
113: return displayName;
114: }
115:
116: /**
117: *
118: */
119: public void setDisplayName(String displayName) {
120: this .displayName = displayName;
121: }
122:
123: /**
124: *
125: */
126: public Set getUsers() {
127: return users;
128: }
129:
130: public String toString() {
131: return "Role[" + key + "," + name + "]";
132: }
133: }
|