commit | author | age
|
9ee357
|
1 |
/* |
U |
2 |
jwtTest - JSON Web Token Testimplementierung |
|
3 |
Copyright (C) 2021 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.httpserver.auth.realm; |
|
19 |
|
|
20 |
/** |
|
21 |
* |
|
22 |
* @author Ulrich Hilger |
|
23 |
* @version 1, 22.05.2021 |
|
24 |
*/ |
|
25 |
public class User { |
|
26 |
private String name; |
|
27 |
private String password; |
696a4b
|
28 |
//private String hash; |
U |
29 |
//private List<String> roles; |
|
30 |
|
|
31 |
public User() { |
|
32 |
//this.roles = new ArrayList(); |
|
33 |
} |
|
34 |
|
|
35 |
/* |
|
36 |
public void addRole(String role) { |
|
37 |
roles.add(role); |
|
38 |
} |
|
39 |
|
|
40 |
public void revokeRole(String role) { |
|
41 |
roles.remove(role); |
|
42 |
} |
|
43 |
|
|
44 |
public boolean hasRole(String role) { |
|
45 |
return roles.contains(role); |
|
46 |
} |
|
47 |
*/ |
9ee357
|
48 |
|
U |
49 |
public String getName() { |
|
50 |
return name; |
|
51 |
} |
|
52 |
|
|
53 |
public void setName(String name) { |
|
54 |
this.name = name; |
|
55 |
} |
|
56 |
|
696a4b
|
57 |
|
9ee357
|
58 |
public String getPassword() { |
U |
59 |
return password; |
|
60 |
} |
|
61 |
|
|
62 |
public void setPassword(String password) { |
|
63 |
this.password = password; |
|
64 |
} |
|
65 |
|
696a4b
|
66 |
|
U |
67 |
/* |
6d44a4
|
68 |
public void setHash(String hash) { |
U |
69 |
this.hash = hash; |
|
70 |
} |
|
71 |
|
|
72 |
public String getHash() { |
|
73 |
return hash; |
|
74 |
} |
696a4b
|
75 |
*/ |
U |
76 |
|
|
77 |
@Override |
|
78 |
public int hashCode() { |
|
79 |
return this.getName().hashCode(); |
|
80 |
} |
|
81 |
|
|
82 |
@Override |
|
83 |
public boolean equals(Object obj) { |
|
84 |
if(obj instanceof User) { |
|
85 |
return this.getName().equals(((User) obj).getName()); |
|
86 |
} else { |
|
87 |
return false; |
|
88 |
} |
|
89 |
} |
6d44a4
|
90 |
|
9ee357
|
91 |
} |