| | |
| | | /* |
| | | 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; |
| | | private String hash; |
| | | |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | |
| | | this.password = password; |
| | | } |
| | | |
| | | public void setHash(String hash) { |
| | | this.hash = hash; |
| | | @Override |
| | | public int hashCode() { |
| | | return this.getName().hashCode(); |
| | | } |
| | | |
| | | public String getHash() { |
| | | return hash; |
| | | |
| | | @Override |
| | | public boolean equals(Object obj) { |
| | | if(obj instanceof User) { |
| | | return this.getName().equals(((User) obj).getName()); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |