com.washingtonpost.dw.auth.model.Peer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-peer-authenticator Show documentation
Show all versions of dropwizard-peer-authenticator Show documentation
Dropwizard Authenticator that uses BasicAuth (user,pass) pairs to control access to your service
The newest version!
package com.washingtonpost.dw.auth.model;
import java.util.Objects;
/**
* Models a remote caller of this service
*/
public class Peer {
private final String username;
private final String password;
public Peer(String username, String password) {
this.username = username;
this.password = password;
}
@Override
public String toString() {
return String.format("Peer{username=%s, password=%s}", this.username, this.password);
}
@Override
public int hashCode() {
int hash = 3;
hash = 59 * hash + Objects.hashCode(this.username);
hash = 59 * hash + Objects.hashCode(this.password);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Peer other = (Peer) obj;
if (!Objects.equals(this.username, other.username)) {
return false;
}
if (!Objects.equals(this.password, other.password)) {
return false;
}
return true;
}
}