Class HostPort

java.lang.Object
io.kroxylicious.proxy.service.HostPort

public final class HostPort extends Object
Represents a host port pair.
  • Constructor Details

    • HostPort

      public HostPort(String host, int port)
      Creates a host port.
      Parameters:
      host - Symbolic hostnames, FQDNs, IPv4, and IPv6 forms are supported
      port - port number
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • host

      public String host()
      host
      Returns:
      host
    • port

      public int port()
      port
      Returns:
      port
    • parse

      public static HostPort parse(String address)

      Parses a host port pair from a string representation.

      For the host part, symbolic hostname, FQDN, IPv4, and IPv6 forms are supported. In the case of IPv6, the notation specified by rfc4038 must be used.

      For the port part, it must be numeric.

      Parameters:
      address - stringified form of the host port, separated by colon (:).
      Returns:
      a HostPort
    • asString

      public static String asString(String host, int port)