com.tencent.polaris.ratelimit.client.flow.HostIdentifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polaris-all Show documentation
Show all versions of polaris-all Show documentation
All in one project for polaris-java
package com.tencent.polaris.ratelimit.client.flow;
import java.util.Objects;
/**
* 节点的唯一标识
*/
public class HostIdentifier {
/**
* host
*/
private final String host;
/**
* port
*/
private final int port;
public HostIdentifier(String host, int port) {
this.host = host;
this.port = port;
}
public String getHost() {
return host;
}
public int getPort() {
return port;
}
@Override
@SuppressWarnings("checkstyle:all")
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
HostIdentifier that = (HostIdentifier) o;
return port == that.port &&
Objects.equals(host, that.host);
}
@Override
public int hashCode() {
return Objects.hash(host, port);
}
@Override
@SuppressWarnings("checkstyle:all")
public String toString() {
return "HostIdentifier{" +
"host='" + host + '\'' +
", port=" + port +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy