|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.common.collect.ForwardingObject
com.google.common.collect.ForwardingCollection<E>
com.google.common.collect.ForwardingList<String>
net.derquinse.common.jaxrs.PathSegments
@Immutable public final class PathSegments
List of non-encoded URI path segments.
| Method Summary | |
|---|---|
PathSegments |
append(PathSegments other)
Appends some segments after this list. |
com.google.common.base.Function<PathSegments,PathSegments> |
appender()
Returns a new transformer that appends this segments to the provided path. |
PathSegments |
appendExtension(String extension)
Appends an extension to the last segment. |
PathSegments |
consume()
|
PathSegments |
consume(int n)
|
PathSegments |
consumeLast()
|
PathSegments |
consumeLast(int n)
|
protected List<String> |
delegate()
|
boolean |
equals(Object object)
|
String |
getExtension()
Extracts the extension from the last segment. |
static String |
getSegmentExtension(String segment)
Extracts the extension from a segment. |
int |
hashCode()
|
String |
head()
|
com.google.common.base.Function<PathSegments,PathSegments> |
inserter()
Returns a new transformer that inserts this segments at the beginning of the provided path. |
String |
join()
|
String |
last()
|
static PathSegments |
of()
Returns an empty list of segments. |
static PathSegments |
of(boolean encoded,
Iterable<String> segments)
Turns a collection of string into a list of decoded segments. |
static PathSegments |
of(boolean encoded,
String... segments)
Turns an array of strings into a list of decoded segments. |
static PathSegments |
of(String path,
boolean encoded)
Turns a path string into a list of decoded segments. |
PathSegments |
removeExtension()
Removes the extension from the last segment. |
static String |
removeSegmentExtension(String segment)
Removes the extension from a segment. |
static PathSegments |
segment(String segment,
boolean encoded)
Turns a single segment into a list of decoded segments. |
String |
toString()
|
| Methods inherited from class com.google.common.collect.ForwardingList |
|---|
add, addAll, get, indexOf, lastIndexOf, listIterator, listIterator, remove, set, standardAdd, standardAddAll, standardEquals, standardHashCode, standardIndexOf, standardIterator, standardLastIndexOf, standardListIterator, standardListIterator, standardSubList, subList |
| Methods inherited from class com.google.common.collect.ForwardingCollection |
|---|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRemoveAll, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Method Detail |
|---|
public static PathSegments of()
public static PathSegments segment(@Nullable
String segment,
boolean encoded)
segment - Segment.encoded - If the segment is encoded.
null list of segments.
public static PathSegments of(@Nullable
String path,
boolean encoded)
path - Path to split.encoded - If the path is encoded.
null list of segments.
public static PathSegments of(boolean encoded,
@Nullable
Iterable<String> segments)
encoded - If the segments are encoded.segments - String segments.
null list of segments.
public static PathSegments of(boolean encoded,
String... segments)
encoded - If the segments are encoded.segments - String segments.
null list of segments.public static String getSegmentExtension(String segment)
segment - Segment.
null if no extension is found.public static String removeSegmentExtension(String segment)
segment - Segment.
protected List<String> delegate()
delegate in class com.google.common.collect.ForwardingList<String>public PathSegments consume(int n)
public PathSegments consumeLast(int n)
public String head()
public String last()
public PathSegments consume()
public PathSegments consumeLast()
public String getExtension()
segment - Segment.
null if no extension is found or the object is empty.
public PathSegments appendExtension(@Nullable
String extension)
extension - Extension to add. If null or only whitespace no operation is
performed.
public PathSegments removeExtension()
public String join()
public PathSegments append(@Nullable
PathSegments other)
other - Segments to add.
public com.google.common.base.Function<PathSegments,PathSegments> inserter()
public com.google.common.base.Function<PathSegments,PathSegments> appender()
segments - Segments to append.
public int hashCode()
hashCode in interface Collection<String>hashCode in interface List<String>hashCode in class com.google.common.collect.ForwardingList<String>public boolean equals(Object object)
equals in interface Collection<String>equals in interface List<String>equals in class com.google.common.collect.ForwardingList<String>public String toString()
toString in class com.google.common.collect.ForwardingObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||