package auth;
public class LDAPAuthentication implements Authentication {
private final String username;
private final String password;
public LDAPAuthentication(String username, String password) {
this.username = username;
this.password = password;
}
@Override
public GrantType getGrantType() {
return GrantType.LDAP;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LDAPAuthentication that = (LDAPAuthentication) o;
if (password != null ? !password.equals(that.password) : that.password != null) {
return false;
}
if (username != null ? !username.equals(that.username) : that.username != null) {
return false;
}
return true;
}
@Override
public int hashCode() {
int result = username != null ? username.hashCode() : 0;
result = 37 * result + (password != null ? password.hashCode() : 0);
return result;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
@Override
public String toString() {
return "LDAPAuthentication{" +
"username='" + username + '\'' +
", password='" + password + '\'' +
'}';
}
}