
io.lettuce.core.tracing.SocketAddressEndpoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lettuce-core Show documentation
Show all versions of lettuce-core Show documentation
Advanced and thread-safe Java Redis client for synchronous, asynchronous, and
reactive usage. Supports Cluster, Sentinel, Pipelining, Auto-Reconnect, Codecs
and much more.
The newest version!
package io.lettuce.core.tracing;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
/**
* {@link Tracing.Endpoint} based on a {@link SocketAddress}.
*
* @author Mark Paluch
* @since 6.3
*/
class SocketAddressEndpoint implements Tracing.Endpoint {
private final SocketAddress socketAddress;
public SocketAddressEndpoint(SocketAddress socketAddress) {
this.socketAddress = socketAddress;
}
public SocketAddress getSocketAddress() {
return socketAddress;
}
@Override
public String toString() {
if (socketAddress instanceof InetSocketAddress) {
InetSocketAddress inet = (InetSocketAddress) socketAddress;
return inet.getHostString() + ":" + inet.getPort();
}
return socketAddress.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy