commit | author | age
|
2a4fb8
|
1 |
/* |
U |
2 |
http-realm - Authentication Extensions to jdk.httpserver |
|
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; |
|
28 |
|
|
29 |
public String getName() { |
|
30 |
return name; |
|
31 |
} |
|
32 |
|
|
33 |
public void setName(String name) { |
|
34 |
this.name = name; |
|
35 |
} |
|
36 |
|
|
37 |
|
|
38 |
public String getPassword() { |
|
39 |
return password; |
|
40 |
} |
|
41 |
|
|
42 |
public void setPassword(String password) { |
|
43 |
this.password = password; |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public int hashCode() { |
|
48 |
return this.getName().hashCode(); |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public boolean equals(Object obj) { |
|
53 |
if(obj instanceof User) { |
|
54 |
return this.getName().equals(((User) obj).getName()); |
|
55 |
} else { |
|
56 |
return false; |
|
57 |
} |
|
58 |
} |
|
59 |
|
|
60 |
} |