Class Host

java.lang.Object
org.apache.hc.core5.net.Host
All Implemented Interfaces:
Serializable, NamedEndpoint

@Contract(threading=IMMUTABLE) public final class Host extends Object implements NamedEndpoint, Serializable
Component that holds all details needed to describe a network connection to a host. This includes remote host name and port.
Since:
5.0
See Also:
  • Constructor Details

    • Host

      public Host(String name, int port)
      Constructs a new instance.
      Parameters:
      name - The host name, not null.
      port - The port value, between 0 and 65535, inclusive. -1 indicates the scheme default port.
      Throws:
      NullPointerException - if the name is null.
      IllegalArgumentException - If the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive. -1 indicates the scheme default port.
  • Method Details