public class NetworkHostAndPort
Tuple of host and port. Use NetworkHostAndPort.Companion.parse
on untrusted data.
NetworkHostAndPort.Companion.parse
Modifier and Type | Class and Description |
---|---|
static class |
NetworkHostAndPort.Companion |
Modifier and Type | Field and Description |
---|---|
static NetworkHostAndPort.Companion |
Companion |
Constructor and Description |
---|
NetworkHostAndPort(java.lang.String host,
int port)
Tuple of host and port. Use
NetworkHostAndPort.Companion.parse on untrusted data. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
component1()
a hostname or IP address.
|
int |
component2()
a valid port number.
|
NetworkHostAndPort |
copy(java.lang.String host,
int port)
Tuple of host and port. Use
NetworkHostAndPort.Companion.parse on untrusted data. |
boolean |
equals(java.lang.Object p) |
java.lang.String |
getHost()
a hostname or IP address.
|
int |
getPort()
a valid port number.
|
int |
hashCode() |
java.lang.String |
toString() |
public static NetworkHostAndPort.Companion Companion
public NetworkHostAndPort(java.lang.String host, int port)
Tuple of host and port. Use NetworkHostAndPort.Companion.parse
on untrusted data.
host
- a hostname or IP address. IPv6 addresses must not be enclosed in square brackets.port
- a valid port number.host
- a hostname or IP address. IPv6 addresses must not be enclosed in square brackets.port
- a valid port number.NetworkHostAndPort.Companion.parse
public java.lang.String toString()
public java.lang.String getHost()
a hostname or IP address.
IPv6 addresses must not be enclosed in square brackets.
public int getPort()
a valid port number.
public java.lang.String component1()
a hostname or IP address.
IPv6 addresses must not be enclosed in square brackets.
public int component2()
a valid port number.
public NetworkHostAndPort copy(java.lang.String host, int port)
Tuple of host and port. Use NetworkHostAndPort.Companion.parse
on untrusted data.
host
- a hostname or IP address. IPv6 addresses must not be enclosed in square brackets.port
- a valid port number.NetworkHostAndPort.Companion.parse
public int hashCode()
public boolean equals(java.lang.Object p)