commit | author | age
|
9ee357
|
1 |
/* |
c7d492
|
2 |
http-auth - Authentication Extensions to jdk.httpserver |
9ee357
|
3 |
Copyright (C) 2021 Ulrich Hilger |
U |
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 |
|
9ee357
|
29 |
public String getName() { |
U |
30 |
return name; |
|
31 |
} |
|
32 |
|
|
33 |
public void setName(String name) { |
|
34 |
this.name = name; |
|
35 |
} |
|
36 |
|
696a4b
|
37 |
|
9ee357
|
38 |
public String getPassword() { |
U |
39 |
return password; |
|
40 |
} |
|
41 |
|
|
42 |
public void setPassword(String password) { |
|
43 |
this.password = password; |
|
44 |
} |
|
45 |
|
696a4b
|
46 |
@Override |
U |
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 |
} |
6d44a4
|
59 |
|
9ee357
|
60 |
} |