Class AddressUtils


  • public final class AddressUtils
    extends java.lang.Object
    A utility class to work with addresses.
    • Method Detail

      • localAddress

        public static java.net.InetSocketAddress localAddress​(int port)
        Creates an InetSocketAddress with loopback address and specified port number.
        Parameters:
        port - the port number
        Returns:
        an InetSocketAddress with loopback address and specified port number
      • hostHeader

        public static java.lang.String hostHeader​(HostAndPort hostAndPort)
        Returns a {code HOST} header value based of the information in HostAndPort.
        Parameters:
        hostAndPort - to convert to the HOST header
        Returns:
        a HOST header value