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

net.leanix.api.common.ProxyConfiguration Maven / Gradle / Ivy

package net.leanix.api.common;

import java.net.URI;
import java.util.Objects;

public class ProxyConfiguration {

    private final URI uri;
    private final String username;
    private final String password;

    public ProxyConfiguration(String host, int port, String username, String password) {
        this(URI.create(String.format("http://%s:%d", Objects.requireNonNull(host), port)), username, password);
    }

    public ProxyConfiguration(URI uri, String username, String password) {
        super();
        this.uri = Objects.requireNonNull(uri);
        this.username = username;
        this.password = password;
    }

    public URI getUri() {
        return uri;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    @Override
    public int hashCode() {
        return Objects.hash(password, uri, username);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        ProxyConfiguration other = (ProxyConfiguration) obj;
        return Objects.equals(password, other.password) && Objects.equals(uri, other.uri)
            && Objects.equals(username, other.username);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy