1 /*
2 =================== DO NOT EDIT THIS FILE ====================
3 Generated by Modello
4 any modifications will be overwritten.
5 ==============================================================
6 */
7
8 package org.codehaus.plexus.security.authorization.rbac.jdo.v0_9_0;
9
10 /**
11 * binding of a principal to a role.
12 *
13 * @version $Revision$ $Date$
14 */
15 public class JdoUserAssignment
16 extends org.codehaus.plexus.security.rbac.AbstractUserAssignment
17 implements org.codehaus.plexus.security.rbac.UserAssignment, java.io.Serializable
18 {
19
20 //--------------------------/
21 //- Class/Member Variables -/
22 //--------------------------/
23
24 /**
25 * Field principal.
26 */
27 private String principal;
28
29 /**
30 * Field timestamp.
31 */
32 private java.util.Date timestamp;
33
34 /**
35 *
36 * true if this object is permanent.
37 *
38 */
39 private boolean permanent = false;
40
41 /**
42 * Field roleNames.
43 */
44 private java.util.List/*<String>*/ roleNames = new java.util.ArrayList/*<String>*/();
45
46
47 //-----------/
48 //- Methods -/
49 //-----------/
50
51 /**
52 * Method equals.
53 *
54 * @param other
55 * @return boolean
56 */
57 public boolean equals( Object other )
58 {
59 if ( this == other )
60 {
61 return true;
62 }
63
64 if ( !( other instanceof JdoUserAssignment ) )
65 {
66 return false;
67 }
68
69 JdoUserAssignment that = (JdoUserAssignment) other;
70 boolean result = true;
71
72 result = result && ( getPrincipal() == null ? that.getPrincipal() == null : getPrincipal().equals( that.getPrincipal() ) );
73 result = result && ( super.equals( other ) );
74
75 return result;
76 } //-- boolean equals( Object )
77
78 /**
79 * Get the principal field.
80 *
81 * @return String
82 */
83 public String getPrincipal()
84 {
85 return this.principal;
86 } //-- String getPrincipal()
87
88 /**
89 * Method getRoleNames.
90 *
91 * @return List
92 */
93 public java.util.List/*<String>*/ getRoleNames()
94 {
95 return this.roleNames;
96 } //-- java.util.List/*<String>*/ getRoleNames()
97
98 /**
99 * Get the timestamp field.
100 *
101 * @return Date
102 */
103 public java.util.Date getTimestamp()
104 {
105 return this.timestamp;
106 } //-- java.util.Date getTimestamp()
107
108 /**
109 * Method hashCode.
110 *
111 * @return int
112 */
113 public int hashCode()
114 {
115 int result = 17;
116
117 result = 37 * result + ( principal != null ? principal.hashCode() : 0 );
118 result = 37 * result + super.hashCode();
119
120 return result;
121 } //-- int hashCode()
122
123 /**
124 * Get true if this object is permanent.
125 *
126 * @return boolean
127 */
128 public boolean isPermanent()
129 {
130 return this.permanent;
131 } //-- boolean isPermanent()
132
133 /**
134 * Set true if this object is permanent.
135 *
136 * @param permanent
137 */
138 public void setPermanent( boolean permanent )
139 {
140 this.permanent = permanent;
141 } //-- void setPermanent( boolean )
142
143 /**
144 * Set the principal field.
145 *
146 * @param principal
147 */
148 public void setPrincipal( String principal )
149 {
150 this.principal = principal;
151 } //-- void setPrincipal( String )
152
153 /**
154 * Set the roleNames field.
155 *
156 * @param roleNames
157 */
158 public void setRoleNames( java.util.List/*<String>*/ roleNames )
159 {
160 this.roleNames = roleNames;
161 } //-- void setRoleNames( java.util.List )
162
163 /**
164 * Set the timestamp field.
165 *
166 * @param timestamp
167 */
168 public void setTimestamp( java.util.Date timestamp )
169 {
170 this.timestamp = timestamp;
171 } //-- void setTimestamp( java.util.Date )
172
173 /**
174 * Method toString.
175 *
176 * @return String
177 */
178 public java.lang.String toString()
179 {
180 StringBuffer buf = new StringBuffer( 128 );
181
182 buf.append( "principal = '" );
183 buf.append( getPrincipal() );
184 buf.append( "'" );
185 buf.append( "\n" );
186 buf.append( super.toString() );
187
188 return buf.toString();
189 } //-- java.lang.String toString()
190
191 }