public final class URLPath extends Object
Modifier and Type | Method and Description |
---|---|
URLPath |
append(URLPath toAppend)
Appends the given url path to this path.
|
URLPath |
appendTrailingSlash()
gives a
URLPath with a trailing slash |
String |
asString()
constructs the string representation of the path.
|
static URLPath |
empty() |
boolean |
equals(Object obj) |
static URLPath |
fromString(String... parts) |
String |
getSegment(int i) |
String |
getSegmentOrEmptyString(int i) |
List<String> |
getSegments()
gives an array of all elements
|
URLPath |
getSubPath(int start)
gives an
URLPath , which contains all elements starting from the
given index. |
URLPath |
getSubPath(int start,
int end)
gives an
URLPath , which contains all elements in the given range. |
int |
hashCode() |
boolean |
hasTrailingSlash()
checks, if this
URLPath ends with a slash |
boolean |
isEmpty()
checks, if this
URLPath have no elements |
boolean |
isRoot()
if this path represents a path root (single slash);
|
URLPath |
removeTrailingSlash()
gives a
URLPath without a trailing slash |
static URLPath |
root() |
int |
size()
gives the count of elements
|
String |
toString() |
public static URLPath root()
public static URLPath empty()
public List<String> getSegments()
public String getSegment(int i)
public String getSegmentOrEmptyString(int i)
public String asString()
public int size()
public boolean isEmpty()
URLPath
have no elementstrue
if this URLPath
have no elements, otherwise
false
public boolean isRoot()
public URLPath getSubPath(int start)
URLPath
, which contains all elements starting from the
given index.public URLPath getSubPath(int start, int end)
URLPath
, which contains all elements in the given range.start
- index (including)end
- index (excluding)URLPath
with the sub elementspublic boolean hasTrailingSlash()
URLPath
ends with a slashtrue
if it contains a trailing slash, otherwise
false
public URLPath removeTrailingSlash()
URLPath
without a trailing slashURLPath
, which have all elements, without a
trailing slashpublic URLPath appendTrailingSlash()
URLPath
with a trailing slashURLPath
, which have all elements, with a
trailing slashCopyright © 2004–2017 52north.org. All rights reserved.