| | |
| | | /* |
| | | jwtTest - JSON Web Token Testimplementierung |
| | | http-auth - Authentication Extensions to jdk.httpserver |
| | | Copyright (C) 2021 Ulrich Hilger |
| | | |
| | | This program is free software: you can redistribute it and/or modify |
| | |
| | | public class User { |
| | | private String name; |
| | | private String password; |
| | | |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | |
| | | this.password = password; |
| | | } |
| | | |
| | | @Override |
| | | public int hashCode() { |
| | | return this.getName().hashCode(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean equals(Object obj) { |
| | | if(obj instanceof User) { |
| | | return this.getName().equals(((User) obj).getName()); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |