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

com.github.shoothzj.javatool.module.HostPort Maven / Gradle / Ivy

The newest version!
package com.github.shoothzj.javatool.module;

/**
 * @author hezhangjian
 */
public class HostPort {
    private String host;
    private int port;

    public HostPort() {
    }

    public String getHost() {
        return this.host;
    }

    public int getPort() {
        return this.port;
    }

    public void setHost(final String host) {
        this.host = host;
    }

    public void setPort(final int port) {
        this.port = port;
    }

    @Override
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof HostPort)) return false;
        final HostPort other = (HostPort) o;
        if (!other.canEqual((Object) this)) return false;
        if (this.getPort() != other.getPort()) return false;
        final Object this$host = this.getHost();
        final Object other$host = other.getHost();
        if (this$host == null ? other$host != null : !this$host.equals(other$host)) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof HostPort;
    }

    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getPort();
        final Object $host = this.getHost();
        result = result * PRIME + ($host == null ? 43 : $host.hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "HostPort(host=" + this.getHost() + ", port=" + this.getPort() + ")";
    }

    public HostPort(final String host, final int port) {
        this.host = host;
        this.port = port;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy