@NotThreadSafe public class SimpleURL extends Object implements ISimpleURL, ICloneable<SimpleURL>
URL.| Constructor and Description |
|---|
SimpleURL() |
SimpleURL(IURLData aURL) |
SimpleURL(String sHref) |
SimpleURL(String sHref,
Charset aCharset) |
SimpleURL(String sHref,
Charset aCharset,
Iterable<? extends URLParameter> aParams,
String sAnchor) |
SimpleURL(String sHref,
Charset aCharset,
Map<String,String> aParams,
String sAnchor) |
SimpleURL(String sHref,
Iterable<? extends URLParameter> aParams,
String sAnchor) |
SimpleURL(String sHref,
Map<String,String> aParams) |
SimpleURL(String sHref,
Map<String,String> aParams,
String sAnchor) |
SimpleURL(URL aURL) |
SimpleURL(URL aURL,
Charset aCharset) |
| Modifier and Type | Method and Description |
|---|---|
SimpleURL |
add(Map.Entry<String,String> aEntry) |
SimpleURL |
add(String sName)
Add a parameter without a value
|
SimpleURL |
add(String sName,
BigInteger aValue) |
SimpleURL |
add(String sName,
boolean bValue) |
SimpleURL |
add(String sName,
int nValue) |
SimpleURL |
add(String sName,
long nValue) |
SimpleURL |
add(String sName,
String sValue) |
SimpleURL |
add(URLParameter aParam) |
SimpleURL |
addAll(Iterable<? extends URLParameter> aParams) |
SimpleURL |
addAll(Map<String,String> aParams) |
SimpleURL |
addIf(String sName,
String sValue,
Predicate<String> aFilter)
Add the parameter of the passed value predicate evaluates to true.
|
SimpleURL |
addIfNotNull(String sName,
String sValue)
Add the parameter of the passed value if it is not null.
|
boolean |
containsParam(String sName)
Check if at least one parameter with the given name is contained.
|
URLParameterList |
directGetAllParams() |
boolean |
equals(Object o) |
URLParameterList |
getAllParams() |
ICommonsList<String> |
getAllParams(String sName)
Get all parameter values of the passed key.
|
String |
getAnchor() |
SimpleURL |
getClone() |
String |
getParam(String sName)
Get the first parameter value of the given key.
|
int |
getParamCount() |
String |
getPath() |
int |
hashCode() |
boolean |
hasParams() |
SimpleURL |
remove(String sName)
Remove all parameters with the given name.
|
SimpleURL |
remove(String sName,
String sValue)
Remove all parameter with the given name.
|
SimpleURL |
setAnchor(String sAnchor) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAsStringWithEncodedParameters, getAsStringWithEncodedParameters, getAsStringWithoutEncodedParametersgetProtocol, hasAnchor, hasAnchor, hasKnownProtocolpublic SimpleURL()
public SimpleURL(@Nonnull String sHref, @Nullable Map<String,String> aParams, @Nullable String sAnchor)
public SimpleURL(@Nonnull String sHref, @Nonnull Charset aCharset, @Nullable Map<String,String> aParams, @Nullable String sAnchor)
public SimpleURL(@Nonnull String sHref, @Nullable Iterable<? extends URLParameter> aParams, @Nullable String sAnchor)
public SimpleURL(@Nonnull String sHref, @Nonnull Charset aCharset, @Nullable Iterable<? extends URLParameter> aParams, @Nullable String sAnchor)
public final boolean hasParams()
@Nonnegative public final int getParamCount()
getParamCount in interface IURLDatapublic final boolean containsParam(@Nullable String sName)
IURLDatacontainsParam in interface IURLDatasName - The name to check. May be null.true if at least one parameter with this name is
present, false otherwise.@Nullable public final String getParam(@Nullable String sName)
IURLData@Nullable public final ICommonsList<String> getAllParams(@Nullable String sName)
IURLDatagetAllParams in interface IURLDatasName - The key to check. May be null.null but maybe empty list.@Nonnull @ReturnsMutableObject(value="design") public final URLParameterList directGetAllParams()
directGetAllParams in interface IURLDatanull.@Nonnull @ReturnsMutableCopy public final URLParameterList getAllParams()
getAllParams in interface IURLDatanull.@Nonnull public final SimpleURL add(@Nonnull @Nonempty String sName)
sName - The name of the parameter. May neither be null nor
empty.@Nonnull public final SimpleURL add(@Nonnull URLParameter aParam)
@Nonnull public final SimpleURL add(@Nonnull @Nonempty String sName, @Nullable BigInteger aValue)
@Nonnull public final SimpleURL addIfNotNull(@Nonnull @Nonempty String sName, @Nullable String sValue)
sName - Parameter name. May neither be null nor empty.sValue - Parameter value. May be null.@Nonnull public final SimpleURL addIf(@Nonnull @Nonempty String sName, @Nullable String sValue, @Nonnull Predicate<String> aFilter)
sName - Parameter name. May neither be null nor empty.sValue - Parameter value. May not be null if the predicate
evaluates to true.aFilter - The predicate to be evaluated on the value. May not be
null.@Nonnull public final SimpleURL addAll(@Nullable Iterable<? extends URLParameter> aParams)
@Nonnull public SimpleURL remove(@Nullable String sName)
sName - The key to remove. May be null in which case nothing
happens.@Nonnull public SimpleURL remove(@Nullable String sName, @Nullable String sValue)
sName - The key to remove. May be null.sValue - The value to be removed. May be null.@Nonnull public SimpleURL getClone()
getClone in interface ICloneable<SimpleURL>Copyright © 2014–2017 Philip Helger. All rights reserved.