Interface HostAndPort
public interface HostAndPort
A combination of host and port.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HostAndPortLikeauthority(String, int)without a port,-1is used instead.static HostAndPortCreate an instance with a validhostfor a valid authority: thehostmust match the host rule of rfc3986.static HostAndPortCreate an arbitrary instance.static HostAndPortfromJson(JsonObject json) host()static HostAndPortparseAuthority(String string, int schemePort) Parse an authority HTTP header, that is host [':' port], according to rfc3986.intport()default JsonObjecttoJson()toString(boolean ssl)
-
Method Details
-
fromJson
-
create
Create an arbitrary instance.- Parameters:
host- the host valueport- the port value- Returns:
- the instance.
-
parseAuthority
Parse an authority HTTP header, that is host [':' port], according to rfc3986.- Parameters:
string- the string to parseschemePort- the scheme port used when the optional port is not specified- Returns:
- the parsed authority or
nullwhen thestringdoes not represent a valid authority.
-
authority
Create an instance with a validhostfor a valid authority: thehostmust match the host rule of rfc3986.- Parameters:
host- the host portionport- the port- Returns:
- the instance
-
authority
Likeauthority(String, int)without a port,-1is used instead. -
host
String host()- Returns:
- the host value
-
port
int port()- Returns:
- the port value or
-1when not specified
-
toString
-
toJson
-