Class PathSegment
java.lang.Object
io.github.grumpystuff.grumpyrest.request.path.PathSegment
- Direct Known Subclasses:
LiteralPathSegment,VariablePathSegment
A single segment from a
Path.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanChecks whether this segment matches a segment of a path from an incoming request.static PathSegmentParses an instance from a single segment of a string-based path specification.
-
Constructor Details
-
PathSegment
protected PathSegment()Constructor.
-
-
Method Details
-
parse
Parses an instance from a single segment of a string-based path specification. The segment is turned into a path parameter (VariablePathSegment) if the segment specification starts with a:character.- Parameters:
segmentSpec- the segment specification- Returns:
- the parsed segment object
-
matches
Checks whether this segment matches a segment of a path from an incoming request.- Parameters:
segment- the request path segment- Returns:
- true if the segment matches, false if not
-