commit | author | age
|
177043
|
1 |
/* |
U |
2 |
neon-auth - Authentication Extensions to Neon |
|
3 |
Copyright (C) 2024 Ulrich Hilger |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
10 |
This program is distributed in the hope that it will be useful, |
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
GNU Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
package de.uhilger.neon.auth; |
|
19 |
|
|
20 |
/** |
|
21 |
* Transportklasse fuer interne Zwecke |
|
22 |
* |
|
23 |
* @author ulrich |
|
24 |
*/ |
|
25 |
public class User { |
|
26 |
private String name; |
|
27 |
private String password; |
|
28 |
|
|
29 |
/** |
|
30 |
* Den Namen des Nutzers ermitteln |
|
31 |
* @return Name des Nutzers |
|
32 |
*/ |
|
33 |
public String getName() { |
|
34 |
return name; |
|
35 |
} |
|
36 |
|
|
37 |
/** |
|
38 |
* Den Namen des Nutzers setzen |
|
39 |
* @param name Name des Nutzers |
|
40 |
*/ |
|
41 |
public void setName(String name) { |
|
42 |
this.name = name; |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* Das Kennwort des Nutzers ermitteln |
|
47 |
* @return Kennwort des Nutzers |
|
48 |
*/ |
|
49 |
public String getPassword() { |
|
50 |
return password; |
|
51 |
} |
|
52 |
|
|
53 |
/** |
|
54 |
* Das Kennwort des Nutzers setzen |
|
55 |
* @param password das Kennwort des Nutzers |
|
56 |
*/ |
|
57 |
public void setPassword(String password) { |
|
58 |
this.password = password; |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* Den Hashcode dieses Objekts ermitteln |
|
63 |
* @return den Hashcode |
|
64 |
*/ |
|
65 |
@Override |
|
66 |
public int hashCode() { |
|
67 |
return this.getName().hashCode(); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Dieses Objekt mit einem anderen Objekt vergleichen |
|
72 |
* @param obj das Objekt, mit dem dieses Objekt verglichen werden soll |
|
73 |
* @return true, wenn die Objekte gleich sind, false, wenn nicht |
|
74 |
*/ |
|
75 |
@Override |
|
76 |
public boolean equals(Object obj) { |
|
77 |
if(obj instanceof User) { |
|
78 |
return this.getName().equals(((User) obj).getName()); |
|
79 |
} else { |
|
80 |
return false; |
|
81 |
} |
|
82 |
} |
|
83 |
|
|
84 |
} |