All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.deepsense.neptune.clientlibrary.api.SimpleCredentials Maven / Gradle / Ivy

There is a newer version: 1.6.1
Show newest version
/**
 * 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