Package io.servicetalk.transport.api
Interface HostAndPort
-
public interface HostAndPortA tuple of<host name, port>.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringhostName()Returns the host name.static HostAndPortof(java.lang.String host, int port)Returns aHostAndPortobject for the specified values.static HostAndPortof(java.net.InetSocketAddress address)Create a newHostAndPortfrom aInetSocketAddress.intport()Returns the port.
-
-
-
Method Detail
-
hostName
java.lang.String hostName()
Returns the host name.- Returns:
- The hostname
-
port
int port()
Returns the port.- Returns:
- The port
-
of
static HostAndPort of(java.lang.String host, int port)
Returns aHostAndPortobject for the specified values.- Parameters:
host- host nameport- port- Returns:
- the
HostAndPort
-
of
static HostAndPort of(java.net.InetSocketAddress address)
Create a newHostAndPortfrom aInetSocketAddress.Note that creation of a
InetSocketAddressmay use the JDK's blocking DNS resolution. Take care to only create these objects if you intend to use the JDK's blocking DNS resolution, and you are safe to block.- Parameters:
address- TheInetSocketAddressto convert.- Returns:
- the
HostAndPort.
-
-