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.keys.jdo.v0_9_0;
9
10 /**
11 *
12 * @plexus.component
13 * role="org.codehaus.plexus.security.keys.AuthenticationKey"
14 * role-hint="jdo"
15 * .
16 *
17 * @version $Revision$ $Date$
18 */
19 public class JdoAuthenticationKey
20 implements org.codehaus.plexus.security.keys.AuthenticationKey, java.io.Serializable
21 {
22
23 //--------------------------/
24 //- Class/Member Variables -/
25 //--------------------------/
26
27 /**
28 * Field key.
29 */
30 private String key;
31
32 /**
33 * Field forPrincipal.
34 */
35 private String forPrincipal;
36
37 /**
38 * Field purpose.
39 */
40 private String purpose;
41
42 /**
43 * Field dateCreated.
44 */
45 private java.util.Date dateCreated;
46
47 /**
48 * Field dateExpires.
49 */
50 private java.util.Date dateExpires;
51
52
53 //-----------/
54 //- Methods -/
55 //-----------/
56
57 /**
58 * Method equals.
59 *
60 * @param other
61 * @return boolean
62 */
63 public boolean equals( Object other )
64 {
65 if ( this == other )
66 {
67 return true;
68 }
69
70 if ( !( other instanceof JdoAuthenticationKey ) )
71 {
72 return false;
73 }
74
75 JdoAuthenticationKey that = (JdoAuthenticationKey) other;
76 boolean result = true;
77
78 result = result && ( getKey() == null ? that.getKey() == null : getKey().equals( that.getKey() ) );
79 result = result && ( getForPrincipal() == null ? that.getForPrincipal() == null : getForPrincipal().equals( that.getForPrincipal() ) );
80
81 return result;
82 } //-- boolean equals( Object )
83
84 /**
85 * Get the dateCreated field.
86 *
87 * @return Date
88 */
89 public java.util.Date getDateCreated()
90 {
91 return this.dateCreated;
92 } //-- java.util.Date getDateCreated()
93
94 /**
95 * Get the dateExpires field.
96 *
97 * @return Date
98 */
99 public java.util.Date getDateExpires()
100 {
101 return this.dateExpires;
102 } //-- java.util.Date getDateExpires()
103
104 /**
105 * Get the forPrincipal field.
106 *
107 * @return String
108 */
109 public String getForPrincipal()
110 {
111 return this.forPrincipal;
112 } //-- String getForPrincipal()
113
114 /**
115 * Get the key field.
116 *
117 * @return String
118 */
119 public String getKey()
120 {
121 return this.key;
122 } //-- String getKey()
123
124 /**
125 * Get the purpose field.
126 *
127 * @return String
128 */
129 public String getPurpose()
130 {
131 return this.purpose;
132 } //-- String getPurpose()
133
134 /**
135 * Method hashCode.
136 *
137 * @return int
138 */
139 public int hashCode()
140 {
141 int result = 17;
142
143 result = 37 * result + ( key != null ? key.hashCode() : 0 );
144 result = 37 * result + ( forPrincipal != null ? forPrincipal.hashCode() : 0 );
145
146 return result;
147 } //-- int hashCode()
148
149 /**
150 * Set the dateCreated field.
151 *
152 * @param dateCreated
153 */
154 public void setDateCreated( java.util.Date dateCreated )
155 {
156 this.dateCreated = dateCreated;
157 } //-- void setDateCreated( java.util.Date )
158
159 /**
160 * Set the dateExpires field.
161 *
162 * @param dateExpires
163 */
164 public void setDateExpires( java.util.Date dateExpires )
165 {
166 this.dateExpires = dateExpires;
167 } //-- void setDateExpires( java.util.Date )
168
169 /**
170 * Set the forPrincipal field.
171 *
172 * @param forPrincipal
173 */
174 public void setForPrincipal( String forPrincipal )
175 {
176 this.forPrincipal = forPrincipal;
177 } //-- void setForPrincipal( String )
178
179 /**
180 * Set the key field.
181 *
182 * @param key
183 */
184 public void setKey( String key )
185 {
186 this.key = key;
187 } //-- void setKey( String )
188
189 /**
190 * Set the purpose field.
191 *
192 * @param purpose
193 */
194 public void setPurpose( String purpose )
195 {
196 this.purpose = purpose;
197 } //-- void setPurpose( String )
198
199 /**
200 * Method toString.
201 *
202 * @return String
203 */
204 public java.lang.String toString()
205 {
206 StringBuffer buf = new StringBuffer( 128 );
207
208 buf.append( "key = '" );
209 buf.append( getKey() );
210 buf.append( "'" );
211 buf.append( "\n" );
212 buf.append( "forPrincipal = '" );
213 buf.append( getForPrincipal() );
214 buf.append( "'" );
215
216 return buf.toString();
217 } //-- java.lang.String toString()
218
219 }