| | |
| | | public class User { |
| | | private String name; |
| | | private String password; |
| | | //private String hash; |
| | | //private List<String> roles; |
| | | |
| | | public User() { |
| | | //this.roles = new ArrayList(); |
| | | } |
| | | |
| | | /* |
| | | public void addRole(String role) { |
| | | roles.add(role); |
| | | } |
| | | |
| | | public void revokeRole(String role) { |
| | | roles.remove(role); |
| | | } |
| | | |
| | | public boolean hasRole(String role) { |
| | | return roles.contains(role); |
| | | } |
| | | */ |
| | | |
| | | public String getName() { |
| | | return name; |
| | |
| | | this.name = name; |
| | | } |
| | | |
| | | |
| | | public String getPassword() { |
| | | return password; |
| | | } |
| | |
| | | this.password = password; |
| | | } |
| | | |
| | | |
| | | /* |
| | | public void setHash(String hash) { |
| | | this.hash = hash; |
| | | } |
| | | |
| | | public String getHash() { |
| | | return hash; |
| | | } |
| | | */ |
| | | |
| | | @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; |
| | | } |
| | | } |
| | | |
| | | } |