Interface ServerAddress


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 Type
    Method
    Description
    Retrieve the host portion of this ServerAddress.
    of(String host, int port)
    Create a new address with the given host and port.
    int
    Retrieve the port portion of this ServerAddress.
  • Method Details

    • host

      String host()
      Retrieve the host portion of this ServerAddress.
      Returns:
      the host, never null.
    • port

      int port()
      Retrieve the port portion of this ServerAddress.
      Returns:
      the port, always in range [0, 65535].
    • of

      static ServerAddress of(String host, int port)
      Create a new address with the given host and port.
      Parameters:
      host - the host portion. Should not be null.
      port - the port portion. Should be in range [0, 65535].
      Returns:
      new server address with the specified host and port.