This project has retired. For details please refer to its
Attic page.
JdoRole xref
1
2
3
4
5
6 package org.apache.archiva.redback.rbac.jdo;
7
8
9
10
11
12
13 public class JdoRole
14 extends org.apache.archiva.redback.rbac.AbstractRole
15 implements org.apache.archiva.redback.rbac.Role, java.io.Serializable
16 {
17
18
19
20
21
22
23
24
25 private String name;
26
27
28
29
30 private String description;
31
32
33
34
35
36
37
38 private boolean assignable = false;
39
40
41
42
43
44
45 private boolean permanent = false;
46
47
48
49
50 private java.util.List
51
52
53
54
55 private java.util.List
56
57
58
59
60
61
62
63
64
65
66
67 public void addChildRoleName( String string )
68 {
69 getChildRoleNames().add( string );
70 }
71
72
73
74
75
76
77 public void addPermission( org.apache.archiva.redback.rbac.Permission jdoPermission )
78 {
79 if ( jdoPermission != null && !( jdoPermission instanceof JdoPermission ) )
80 {
81 throw new ClassCastException( "JdoRole.addPermissions( jdoPermission ) parameter must be instanceof " + JdoPermission.class.getName() );
82 }
83 getPermissions().add( ( (JdoPermission) jdoPermission ) );
84 }
85
86
87
88
89
90
91
92 public boolean equals( Object other )
93 {
94 if ( this == other )
95 {
96 return true;
97 }
98
99 if ( !( other instanceof JdoRole ) )
100 {
101 return false;
102 }
103
104 JdoRole that = (JdoRole) other;
105 boolean result = true;
106
107 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
108 result = result && ( super.equals( other ) );
109
110 return result;
111 }
112
113
114
115
116
117
118 public java.util.List
119 {
120 return this.childRoleNames;
121 }
122
123
124
125
126
127
128 public String getDescription()
129 {
130 return this.description;
131 }
132
133
134
135
136
137
138 public String getName()
139 {
140 return this.name;
141 }
142
143
144
145
146
147
148 public java.util.List
149 {
150 return this.permissions;
151 }
152
153
154
155
156
157
158 public int hashCode()
159 {
160 int result = 17;
161
162 result = 37 * result + ( name != null ? name.hashCode() : 0 );
163 result = 37 * result + super.hashCode();
164
165 return result;
166 }
167
168
169
170
171
172
173 public boolean isAssignable()
174 {
175 return this.assignable;
176 }
177
178
179
180
181
182
183 public boolean isPermanent()
184 {
185 return this.permanent;
186 }
187
188
189
190
191
192
193 public void removeChildRoleName( String string )
194 {
195 getChildRoleNames().remove( string );
196 }
197
198
199
200
201
202
203 public void removePermission( org.apache.archiva.redback.rbac.Permission jdoPermission )
204 {
205 if ( jdoPermission != null && !( jdoPermission instanceof JdoPermission ) )
206 {
207 throw new ClassCastException( "JdoRole.removePermissions( jdoPermission ) parameter must be instanceof " + JdoPermission.class.getName() );
208 }
209 getPermissions().remove( ( (JdoPermission) jdoPermission ) );
210 }
211
212
213
214
215
216
217 public void setAssignable( boolean assignable )
218 {
219 this.assignable = assignable;
220 }
221
222
223
224
225
226
227 public void setChildRoleNames( java.util.List
228 {
229 this.childRoleNames = childRoleNames;
230 }
231
232
233
234
235
236
237 public void setDescription( String description )
238 {
239 this.description = description;
240 }
241
242
243
244
245
246
247 public void setName( String name )
248 {
249 this.name = name;
250 }
251
252
253
254
255
256
257 public void setPermanent( boolean permanent )
258 {
259 this.permanent = permanent;
260 }
261
262
263
264
265
266
267 public void setPermissions( java.util.List
268 {
269 this.permissions = permissions;
270 }
271
272
273
274
275
276
277 public java.lang.String toString()
278 {
279 StringBuffer buf = new StringBuffer( 128 );
280
281 buf.append( "name = '" );
282 buf.append( getName() );
283 buf.append( "'" );
284 buf.append( "\n" );
285 buf.append( super.toString() );
286
287 return buf.toString();
288 }
289
290 }