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