Package org.wiremock.url
Interface PercentEncoded<SELF extends PercentEncoded<SELF>>
- All Superinterfaces:
Normalisable<SELF>,org.wiremock.stringparser.ParsedString
- All Known Subinterfaces:
Fragment,Host,Password,Path,Query,QueryParamKey,QueryParamValue,Segment,UserInfo,Username
public interface PercentEncoded<SELF extends PercentEncoded<SELF>>
extends Normalisable<SELF>, org.wiremock.stringparser.ParsedString
Represents a string that may contain percent-encoded characters as defined in RFC 3986 Section 2.1.
Percent-encoding is a mechanism to represent characters that are not allowed or have special
meaning in URIs. Characters are encoded as a percent sign (%) followed by two hexadecimal
digits representing the byte value.
Implementations must provide a Object.toString() method that returns the
percent-encoded string representation.
Implementations must be immutable and thread-safe.
- See Also:
-
Method Summary
Methods inherited from interface org.wiremock.url.Normalisable
isNormalForm, normaliseMethods inherited from interface org.wiremock.stringparser.ParsedString
toString
-
Method Details
-
decode
Decodes all percent-encoded sequences in this string.Sequences like
%20are decoded to their corresponding characters using UTF-8 encoding.- Returns:
- the decoded string
-
length
default int length()Returns the length of this percent-encoded string.- Returns:
- the length of the string
-
isEmpty
default boolean isEmpty()Returnstrueif this percent-encoded string is empty.- Returns:
trueif the string has zero length
-