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

com.github.joekerouac.common.tools.net.http.config.HttpProxy Maven / Gradle / Ivy

The newest version!
// Generated by delombok at Fri Mar 14 11:41:38 CST 2025
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
 * file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
 * to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package com.github.joekerouac.common.tools.net.http.config;

/**
 * 代理服务器
 * 
 * @since 1.0.0
 * @author JoeKerouac
 * @date 2022-10-14 14:37:00
 */
public final class HttpProxy {
    /**
     * 代理主机
     */
    private String host;
    /**
     * 代理端口
     */
    private int port;
    /**
     * 代理主机如果需要认证的话需要填这个参数,用户名,当用户名不为空时将会开启认证
     */
    private String username;
    /**
     * 密码
     */
    private String password;

    public HttpProxy(String host, int port) {
        this(host, port, null, null);
    }

    public HttpProxy(String host, int port, String username, String password) {
        this.host = host;
        this.port = port;
        this.username = username;
        this.password = password;
    }

    /**
     * 代理主机
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getHost() {
        return this.host;
    }

    /**
     * 代理端口
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int getPort() {
        return this.port;
    }

    /**
     * 代理主机如果需要认证的话需要填这个参数,用户名,当用户名不为空时将会开启认证
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getUsername() {
        return this.username;
    }

    /**
     * 密码
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public String getPassword() {
        return this.password;
    }

    /**
     * 代理主机
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setHost(final String host) {
        this.host = host;
    }

    /**
     * 代理端口
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setPort(final int port) {
        this.port = port;
    }

    /**
     * 代理主机如果需要认证的话需要填这个参数,用户名,当用户名不为空时将会开启认证
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setUsername(final String username) {
        this.username = username;
    }

    /**
     * 密码
     */
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setPassword(final String password) {
        this.password = password;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof HttpProxy)) return false;
        final HttpProxy other = (HttpProxy) o;
        if (this.getPort() != other.getPort()) return false;
        final java.lang.Object this$host = this.getHost();
        final java.lang.Object other$host = other.getHost();
        if (this$host == null ? other$host != null : !this$host.equals(other$host)) return false;
        final java.lang.Object this$username = this.getUsername();
        final java.lang.Object other$username = other.getUsername();
        if (this$username == null ? other$username != null : !this$username.equals(other$username)) return false;
        final java.lang.Object this$password = this.getPassword();
        final java.lang.Object other$password = other.getPassword();
        if (this$password == null ? other$password != null : !this$password.equals(other$password)) return false;
        return true;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getPort();
        final java.lang.Object $host = this.getHost();
        result = result * PRIME + ($host == null ? 43 : $host.hashCode());
        final java.lang.Object $username = this.getUsername();
        result = result * PRIME + ($username == null ? 43 : $username.hashCode());
        final java.lang.Object $password = this.getPassword();
        result = result * PRIME + ($password == null ? 43 : $password.hashCode());
        return result;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "HttpProxy(host=" + this.getHost() + ", port=" + this.getPort() + ", username=" + this.getUsername() + ", password=" + this.getPassword() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy