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

io.github.carlosthe19916.webservices.wrappers.ServiceConfig Maven / Gradle / Ivy

There is a newer version: 1.3.4.Final
Show newest version
package io.github.carlosthe19916.webservices.wrappers;

import java.util.Objects;

public class ServiceConfig {

    private final String url;
    private final String username;
    private final String password;

    private ServiceConfig(Builder builder) {
        this.url = builder.url;
        this.username = builder.username;
        this.password = builder.password;
    }

    public String getUrl() {
        return url;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public static class Builder {
        private String url;
        private String username;
        private String password;

        public Builder url(String url) {
            this.url = url;
            return this;
        }

        public Builder username(String username) {
            this.username = username;
            return this;
        }

        public Builder password(String password) {
            this.password = password;
            return this;
        }

        public ServiceConfig build() {
            return new ServiceConfig(this);
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ServiceConfig that = (ServiceConfig) o;
        return Objects.equals(url, that.url) &&
                Objects.equals(username, that.username) &&
                Objects.equals(password, that.password);
    }

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy