1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.om.servlet.impl;
18
19 import java.io.Serializable;
20
21 import org.apache.jetspeed.om.common.servlet.MutableSecurityRole;
22 import org.apache.pluto.om.common.SecurityRole;
23
24 /***
25 * MutableSecurityRoleImpl
26 *
27 * @author <a href="mailto:ate@douma.nu">Ate Douma </a>
28 * @version $Id: SecurityRoleImpl.java 516881 2007-03-11 10:34:21Z ate $
29 */
30 public class SecurityRoleImpl implements SecurityRole, MutableSecurityRole, Serializable {
31
32 protected long webAppId;
33
34 private String description;
35
36 private String roleName;
37
38 /***
39 * Default constructor.
40 */
41 public SecurityRoleImpl() {
42 }
43
44 /***
45 * @see org.apache.pluto.om.common.SecurityRole#getDescription()
46 */
47 public String getDescription() {
48 return description;
49 }
50
51 /***
52 * @see org.apache.pluto.om.common.SecurityRole#getRoleName()
53 */
54 public String getRoleName() {
55 return roleName;
56 }
57
58 /***
59 * @see org.apache.jetspeed.om.common.servlet.MutableSecurityRole#setDescription(java.lang.String)
60 */
61 public void setDescription(String description) {
62 this.description = description;
63 }
64
65 /***
66 * @see org.apache.jetspeed.om.common.servlet.MutableSecurityRole#setRoleName(java.lang.String)
67 */
68 public void setRoleName(String roleName) {
69 this.roleName = roleName;
70 }
71
72 /***
73 * Convert {@link SecurityRole}to String.
74 *
75 * @return String value of SecurityRole.
76 */
77 public String toString() {
78 String securityRole = "[[roleName, " + this.roleName + "], [description, " + this.description + "]]";
79 return securityRole;
80 }
81
82 /***
83 * @see java.lang.Object#equals(java.lang.Object)
84 */
85 public boolean equals(Object obj) {
86 if ( obj != null && obj instanceof SecurityRoleImpl ) {
87
88
89
90
91
92
93
94 return getRoleName() != null && getRoleName().equals(((SecurityRoleImpl)obj).getRoleName());
95 }
96 return false;
97 }
98
99 /***
100 * @see java.lang.Object#hashCode()
101 */
102 public int hashCode() {
103
104
105
106
107
108
109
110 return getRoleName() != null ? getRoleName().hashCode() : 0;
111 }
112 }