io.deepsense.neptune.clientlibrary.api.SimpleCredentials Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptune-client-library Show documentation
Show all versions of neptune-client-library Show documentation
Enables integration with Neptune in your Java code
/**
* Copyright (c) 2016, CodiLime Inc.
*/
package io.deepsense.neptune.clientlibrary.api;
import java.util.Objects;
import java.util.Optional;
public class SimpleCredentials implements Credentials {
private final String username;
private final String password;
public SimpleCredentials(String username, String password) {
this.username = username;
this.password = password;
}
public Optional getUsername() {
return Optional.ofNullable(username);
}
public Optional getPassword() {
return Optional.ofNullable(password);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SimpleCredentials that = (SimpleCredentials) o;
return Objects.equals(username, that.username)
&& Objects.equals(password, that.password);
}
@Override
public int hashCode() {
return Objects.hash(username, password);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy