Package com.helger.commons.url
Interface ISimpleURL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringgetAnchor()default StringgetAsStringWithEncodedParameters()default StringgetAsStringWithEncodedParameters(Charset aCharset)default StringgetAsStringWithoutEncodedParameters()default URIgetAsURI()default URLgetAsURL()StringgetPath()default IURLProtocolgetProtocol()default booleanhasAnchor()default booleanhasAnchor(String sAnchor)Check if this URL has an anchor with the passed name.default booleanhasKnownProtocol()URLParameterListparams()
-
-
-
Method Detail
-
getProtocol
@Nullable default IURLProtocol getProtocol()
- Returns:
- The protocol used. May be
nullfor an unknown protocol.
-
hasKnownProtocol
default boolean hasKnownProtocol()
- Returns:
trueif the URL has a known protocol
-
getPath
@Nonnull String getPath()
- Returns:
- The path part of the URL (everything before the "?" and the "#",
incl. the protocol). Never
nullbut maybe empty (e.g. for "?x=y").
-
params
@Nullable @ReturnsMutableObject URLParameterList params()
- Returns:
- A map of all query string parameters. May be
null.
-
getAnchor
@Nullable String getAnchor()
- Returns:
- The name of the anchor (everything after the "#") or
nullif none is defined.
-
hasAnchor
default boolean hasAnchor()
- Returns:
trueif an anchor is present,falseotherwise.
-
hasAnchor
default boolean hasAnchor(@Nullable String sAnchor)
Check if this URL has an anchor with the passed name.- Parameters:
sAnchor- The anchor name to check.- Returns:
trueif the passed anchor is present.
-
getAsStringWithoutEncodedParameters
@Nonnull default String getAsStringWithoutEncodedParameters()
- Returns:
- The final string representation of this URL not encoding the request parameters.
-
getAsStringWithEncodedParameters
@Nonnull default String getAsStringWithEncodedParameters()
- Returns:
- The final string representation of this URL with encoded URL
parameter keys and values. Using the default URL charset as
determined by
URLHelper.CHARSET_URL_OBJ.
-
getAsStringWithEncodedParameters
@Nonnull default String getAsStringWithEncodedParameters(@Nonnull Charset aCharset)
- Parameters:
aCharset- The charset used for encoding the parameters. May not benull.- Returns:
- The final string representation of this URL with encoded URL parameter keys and values.
-
-