Class URIAuthority

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

@Contract(threading=IMMUTABLE) public final class URIAuthority extends Object implements NamedEndpoint, Serializable
Represents authority component of request URI.
Since:
5.0
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • userInfo

      private final String userInfo
    • host

      private final Host host
  • Constructor Details

    • URIAuthority

      public URIAuthority(String userInfo, String hostName, int port)
      Constructs a new instance.
      Parameters:
      userInfo - The user info, may be null.
      hostName - 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 is outside the specified range of valid port values, which is between 0 and 65535, inclusive. -1 indicates the scheme default port.
    • URIAuthority

      public URIAuthority(String hostName, int port)
      Constructs a new instance.
      Parameters:
      hostName - 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 is outside the specified range of valid port values, which is between 0 and 65535, inclusive. -1 indicates the scheme default port.
    • URIAuthority

      public URIAuthority(String userInfo, Host host)
      Constructs a new instance.
      Parameters:
      userInfo - The user info, may be null.
      host - The host, never null.
      Throws:
      NullPointerException - if the host is null.
      Since:
      5.2
    • URIAuthority

      public URIAuthority(Host host)
      Constructs a new instance.
      Parameters:
      host - The host, never null.
      Throws:
      NullPointerException - if the host is null.
      Since:
      5.2
    • URIAuthority

      public URIAuthority(String userInfo, NamedEndpoint endpoint)
      Constructs a new instance.
      Parameters:
      userInfo - The user info, may be null.
      endpoint - The named end-point, never null.
      Throws:
      NullPointerException - If the end-point is null.
      NullPointerException - If the end-point name is null.
      IllegalArgumentException - If the end-point port is outside the specified range of valid port values, which is between 0 and 65535, inclusive. -1 indicates the scheme default port.
      Since:
      5.2
    • URIAuthority

      public URIAuthority(NamedEndpoint namedEndpoint)
      Constructs a new instance.
      Parameters:
      namedEndpoint - The named end-point, never null.
      Throws:
      NullPointerException - If the end-point is null.
      NullPointerException - If the end-point name is null.
      IllegalArgumentException - If the end-point port is outside the specified range of valid port values, which is between 0 and 65535, inclusive. -1 indicates the scheme default port.
    • URIAuthority

      public URIAuthority(String hostName)
      Constructs a new instance.
      Parameters:
      hostName - The host name, not null.
      Throws:
      NullPointerException - If the name is null.
  • Method Details