@Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o instanceof BasicUserPrincipal) {
            final BasicUserPrincipal that = (BasicUserPrincipal) o;
            return Objects.equals(this.username, that.username);
        }
        return false;
    }
Basic username based principal representation.

@since 4.0
httpclient5/src/main/java/org/apache/hc/client5/http/auth/BasicUserPrincipal.java