Package org.wiremock.url
Interface Username
- All Superinterfaces:
Normalisable<Username>,org.wiremock.stringparser.ParsedString,PercentEncoded<Username>
Represents the username portion of user information in a URI authority.
The username is the part before the colon in user information (username:password).
Usernames may contain percent-encoded characters.
Implementations must be immutable and thread-safe.
- See Also:
-
Method Summary
Static MethodsMethods inherited from interface org.wiremock.url.Normalisable
isNormalForm, normaliseMethods inherited from interface org.wiremock.stringparser.ParsedString
toStringMethods inherited from interface org.wiremock.url.PercentEncoded
decode, isEmpty, length
-
Method Details
-
parse
Parses a string into a username.- Parameters:
username- the string to parse- Returns:
- the parsed username
- Throws:
IllegalUsername- if the string is not a valid username
-
encode
Encodes a string into a valid username with proper percent-encoding.- Parameters:
unencoded- the unencoded string- Returns:
- the encoded username
-