Package com.helger.commons.url
Class SimpleURL
- java.lang.Object
-
- com.helger.commons.url.SimpleURL
-
- All Implemented Interfaces:
ICloneable<SimpleURL>,IGenericImplTrait<SimpleURL>,ISimpleURL,IURLParameterList<SimpleURL>
@NotThreadSafe public class SimpleURL extends Object implements ISimpleURL, ICloneable<SimpleURL>, IURLParameterList<SimpleURL>
Abstraction of the string parts of a URL but much simpler (and faster) thanURL.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description SimpleURL()SimpleURL(ISimpleURL aURL)SimpleURL(String sHref)SimpleURL(String sHref, Iterable<? extends URLParameter> aParams, String sAnchor)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, Map<String,String> aParams)SimpleURL(String sHref, Map<String,String> aParams, String sAnchor)SimpleURL(URI aURI)SimpleURL(URI aURI, Charset aCharset)SimpleURL(URL aURL)SimpleURL(URL aURL, Charset aCharset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(URLParameter aParam)booleanequals(Object o)StringgetAnchor()SimpleURLgetClone()StringgetPath()inthashCode()URLParameterListparams()SimpleURLsetAnchor(String sAnchor)SimpleURLsetPath(String sPath)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsT
-
Methods inherited from interface com.helger.commons.url.ISimpleURL
getAsStringWithEncodedParameters, getAsStringWithEncodedParameters, getAsStringWithoutEncodedParameters, getAsURI, getAsURL, getProtocol, hasAnchor, hasAnchor, hasKnownProtocol
-
-
-
-
Constructor Detail
-
SimpleURL
public SimpleURL()
-
SimpleURL
public SimpleURL(@Nonnull String sHref, @Nullable Map<String,String> aParams, @Nullable String sAnchor)
-
SimpleURL
public SimpleURL(@Nonnull String sHref, @Nonnull Charset aCharset, @Nullable Map<String,String> aParams, @Nullable String sAnchor)
-
SimpleURL
public SimpleURL(@Nonnull String sHref, @Nullable Iterable<? extends URLParameter> aParams, @Nullable String sAnchor)
-
SimpleURL
public SimpleURL(@Nonnull String sHref, @Nonnull Charset aCharset, @Nullable Iterable<? extends URLParameter> aParams, @Nullable String sAnchor)
-
SimpleURL
public SimpleURL(@Nonnull ISimpleURL aURL)
-
-
Method Detail
-
getPath
@Nonnull public final String getPath()
- Specified by:
getPathin interfaceISimpleURL- 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
@Nonnull @ReturnsMutableObject public final URLParameterList params()
- Specified by:
paramsin interfaceISimpleURL- Returns:
- A map of all query string parameters. May be
null.
-
add
public boolean add(@Nonnull URLParameter aParam)
- Specified by:
addin interfaceIURLParameterList<SimpleURL>
-
getAnchor
@Nullable public final String getAnchor()
- Specified by:
getAnchorin interfaceISimpleURL- Returns:
- The name of the anchor (everything after the "#") or
nullif none is defined.
-
getClone
@Nonnull public SimpleURL getClone()
- Specified by:
getClonein interfaceICloneable<SimpleURL>- Returns:
- A 100% deep-copy of the implementing class.
-
-