public interface HostAndPort
<host name, port>
.Modifier and Type | Method and Description |
---|---|
java.lang.String |
hostName()
Returns the host name.
|
static HostAndPort |
of(java.net.InetSocketAddress address)
Create a new
HostAndPort from a InetSocketAddress . |
static HostAndPort |
of(java.lang.String host,
int port)
Returns a
HostAndPort object for the specified values. |
int |
port()
Returns the port.
|
java.lang.String hostName()
int port()
static HostAndPort of(java.lang.String host, int port)
HostAndPort
object for the specified values.host
- host nameport
- portHostAndPort
static HostAndPort of(java.net.InetSocketAddress address)
HostAndPort
from a InetSocketAddress
.
Note that creation of a InetSocketAddress
may 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.
address
- The InetSocketAddress
to convert.HostAndPort
.