1
2
3
4
5
6
7
8 package org.codehaus.plexus.security.authorization.rbac.jdo.v0_9_0;
9
10
11
12
13
14
15 public class JdoPermission
16 implements org.codehaus.plexus.security.rbac.Permission, java.io.Serializable
17 {
18
19
20
21
22
23
24
25
26 private String name;
27
28
29
30
31 private String description;
32
33
34
35
36
37
38 private boolean permanent = false;
39
40
41
42
43 private JdoOperation operation;
44
45
46
47
48 private JdoResource resource;
49
50
51
52
53
54
55
56
57
58
59
60
61 public boolean equals( Object other )
62 {
63 if ( this == other )
64 {
65 return true;
66 }
67
68 if ( !( other instanceof JdoPermission ) )
69 {
70 return false;
71 }
72
73 JdoPermission that = (JdoPermission) other;
74 boolean result = true;
75
76 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
77
78 return result;
79 }
80
81
82
83
84
85
86 public String getDescription()
87 {
88 return this.description;
89 }
90
91
92
93
94
95
96 public String getName()
97 {
98 return this.name;
99 }
100
101
102
103
104
105
106 public org.codehaus.plexus.security.rbac.Operation getOperation()
107 {
108 return (org.codehaus.plexus.security.rbac.Operation) this.operation;
109 }
110
111
112
113
114
115
116 public org.codehaus.plexus.security.rbac.Resource getResource()
117 {
118 return (org.codehaus.plexus.security.rbac.Resource) this.resource;
119 }
120
121
122
123
124
125
126 public int hashCode()
127 {
128 int result = 17;
129
130 result = 37 * result + ( name != null ? name.hashCode() : 0 );
131
132 return result;
133 }
134
135
136
137
138
139
140 public boolean isPermanent()
141 {
142 return this.permanent;
143 }
144
145
146
147
148
149
150 public void setDescription( String description )
151 {
152 this.description = description;
153 }
154
155
156
157
158
159
160 public void setName( String name )
161 {
162 this.name = name;
163 }
164
165
166
167
168
169
170 public void setOperation( org.codehaus.plexus.security.rbac.Operation operation )
171 {
172 if ( !( operation instanceof JdoOperation ) )
173 {
174 throw new ClassCastException( "JdoPermission.setOperation( operation ) parameter must be instanceof " + JdoOperation.class.getName() );
175 }
176 this.operation = (JdoOperation) operation;
177 }
178
179
180
181
182
183
184 public void setPermanent( boolean permanent )
185 {
186 this.permanent = permanent;
187 }
188
189
190
191
192
193
194 public void setResource( org.codehaus.plexus.security.rbac.Resource resource )
195 {
196 if ( !( resource instanceof JdoResource ) )
197 {
198 throw new ClassCastException( "JdoPermission.setResource( resource ) parameter must be instanceof " + JdoResource.class.getName() );
199 }
200 this.resource = (JdoResource) resource;
201 }
202
203
204
205
206
207
208 public java.lang.String toString()
209 {
210 StringBuffer buf = new StringBuffer( 128 );
211
212 buf.append( "name = '" );
213 buf.append( getName() );
214 buf.append( "'" );
215
216 return buf.toString();
217 }
218
219 }