Class UriAuthority
java.lang.Object
io.helidon.common.uri.UriAuthority
Normalized URI authority.
URI authority is a host plus an optional port. Userinfo is not supported.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic UriAuthorityCreate a normalized authority from a host and optional port.static UriAuthorityParse and normalize authority text.booleaninthashCode()booleanhasPort()Whether the authority has a port.host()Host.intport()Port.intportOrDefault(int defaultPort) Port or a default value.toString()
-
Field Details
-
UNDEFINED_PORT
public static final int UNDEFINED_PORTUndefined port value.- See Also:
-
-
Method Details
-
create
Create a normalized authority from a host and optional port.- Parameters:
host- normalized hostport- port, or -1 when absent- Returns:
- normalized authority
- Throws:
NullPointerException- in case the host isnullIllegalArgumentException- in case the port is invalid
-
create
Parse and normalize authority text.DNS hosts are normalized to lower-case ASCII. IPv6 authorities must use brackets.
- Parameters:
authority- authority text containing a host and optional port- Returns:
- normalized authority
- Throws:
NullPointerException- in case the authority isnullIllegalArgumentException- in case the authority is invalid
-
host
-
port
-
hasPort
public boolean hasPort()Whether the authority has a port.- Returns:
- whether a port is defined
-
portOrDefault
public int portOrDefault(int defaultPort) Port or a default value.- Parameters:
defaultPort- default port to use when the authority has no port- Returns:
- authority port or the provided default port
-
equals
-
hashCode
-
toString
-