public interface ServerAddress
Represents a host and port. Host can either be an IP address or a DNS name.
Both IPv4 and IPv6 hosts are supported.
-
Method Summary
Modifier and TypeMethodDescriptionhost()Retrieve the host portion of thisServerAddress.static ServerAddressCreate a new address with the given host using the default bolt port.static ServerAddressCreate a new address with the given host and port.intport()Retrieve the port portion of thisServerAddress.
-
Method Details
-
host
String host()Retrieve the host portion of thisServerAddress.- Returns:
- the host, never
null.
-
port
int port()Retrieve the port portion of thisServerAddress.- Returns:
- the port, always in range [0, 65535].
-
of
Create a new address with the given host and port.- Parameters:
host- the host portion. Should not benull.port- the port portion. Should be in range [0, 65535].- Returns:
- new server address with the specified host and port.
-
of
Create a new address with the given host using the default bolt port.- Parameters:
host- the host portion. Should not benull.- Returns:
- new server address with the specified host and default bolt port.
- Since:
- 5.24.0
-