This project has retired. For details please refer to its
Attic page.
MemoryUserAssignment xref
1 package org.apache.archiva.redback.rbac.memory;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.archiva.redback.rbac.AbstractUserAssignment;
23 import org.apache.archiva.redback.rbac.UserAssignment;
24
25 import java.util.ArrayList;
26 import java.util.List;
27
28
29
30
31
32
33
34 public class MemoryUserAssignment
35 extends AbstractUserAssignment
36 implements UserAssignment, java.io.Serializable
37 {
38
39
40
41
42 private String principal;
43
44
45
46
47 private List<String> roles = new ArrayList<String>( 0 );
48
49
50
51
52 private boolean permanent = false;
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 MemoryUserAssignment ) )
67 {
68 return false;
69 }
70
71 MemoryUserAssignment that = (MemoryUserAssignment) other;
72 boolean result = true;
73 result = result && ( getPrincipal() == null
74 ? that.getPrincipal() == null
75 : getPrincipal().equals( that.getPrincipal() ) );
76 return result;
77 }
78
79
80
81
82 public String getPrincipal()
83 {
84 return this.principal;
85 }
86
87
88
89
90 public List<String> getRoleNames()
91 {
92 if ( this.roles == null )
93 {
94 this.roles = new ArrayList<String>( 0 );
95 }
96
97 return this.roles;
98 }
99
100
101
102
103 public int hashCode()
104 {
105 int result = 17;
106 result = 37 * result + ( principal != null ? principal.hashCode() : 0 );
107 return result;
108 }
109
110
111
112
113
114
115 public void setPrincipal( String principal )
116 {
117 this.principal = principal;
118 }
119
120
121
122
123
124
125 public void setRoleNames( List<String> roles )
126 {
127 this.roles = roles;
128 }
129
130
131
132
133 public java.lang.String toString()
134 {
135 StringBuilder buf = new StringBuilder();
136 buf.append( "principal = '" );
137 buf.append( getPrincipal() + "'" );
138 return buf.toString();
139 }
140
141 public boolean isPermanent()
142 {
143 return permanent;
144 }
145
146 public void setPermanent( boolean permanent )
147 {
148 this.permanent = permanent;
149 }
150 }