Package org.wiremock.url
Interface Host
- All Superinterfaces:
Normalisable<Host>,org.wiremock.stringparser.ParsedString,PercentEncoded<Host>
Represents the host component of a URI as defined in RFC 3986 Section 3.2.2.
A host can be an IP address (IPv4 or IPv6), a registered name (domain name), or an IPvFuture address. Registered names may contain percent-encoded characters.
Implementations must be immutable and thread-safe.
- See Also:
-
Field Summary
Fields -
Method Summary
Methods inherited from interface org.wiremock.stringparser.ParsedString
toStringMethods inherited from interface org.wiremock.url.PercentEncoded
decode, isEmpty, length
-
Field Details
-
EMPTY
-
LOCALHOST
-
-
Method Details
-
normalise
Host normalise()Returns a normalised form of this host.Normalization includes converting registered names to lowercase and normalizing percent-encoding.
- Specified by:
normalisein interfaceNormalisable<Host>- Returns:
- a normalised host
-
parse
Parses a string into a host.- Parameters:
hostString- the string to parse- Returns:
- the parsed host
- Throws:
IllegalHost- if the string is not a valid host
-
encode
Encodes a string into a valid host with proper percent-encoding.- Parameters:
unencoded- the unencoded string- Returns:
- the encoded host
-
isNormalForm
boolean isNormalForm()Returnstrueif this host is in normal form.- Specified by:
isNormalFormin interfaceNormalisable<Host>- Returns:
trueif this is in normal form
-