public final class UriPattern extends SmithyPattern
A URI pattern is an absolute path segment used to route to operations. The pattern must start with "/", must not contain empty segments (i.e., "//"), must not contain a fragment (i.e., "#"), and must not end with "?".
Labels may appear in the pattern in the form of "{label}". Labels must not be repeated, must make up an entire path segment (e.g., "/{foo}/baz"), and the label name must match the regex "^[a-zA-Z0-9_]+$". No labels can appear after the query string.
Greedy labels, a specialized type of label, may be specified using "{label+}". Only a single greedy label may appear in a pattern, and it must be the last label in a pattern.
SmithyPattern.Builder, SmithyPattern.Segment
Modifier and Type | Method and Description |
---|---|
boolean |
conflictsWith(UriPattern otherPattern)
Determines if the pattern conflicts with another pattern.
|
boolean |
equals(java.lang.Object other) |
java.util.List<Pair<SmithyPattern.Segment,SmithyPattern.Segment>> |
getConflictingLabelSegments(UriPattern otherPattern)
Deprecated.
|
java.util.Map<java.lang.String,java.lang.String> |
getQueryLiterals()
Get an immutable map of query string literal key-value pairs.
|
java.util.Optional<java.lang.String> |
getQueryLiteralValue(java.lang.String parameter)
Gets a specific query string literal parameter value.
|
int |
hashCode() |
static UriPattern |
parse(java.lang.String uri)
Parse a URI pattern string into a UriPattern.
|
builder, getConflictingLabelSegmentsMap, getGreedyLabel, getLabel, getLabels, getSegments, toString
public static UriPattern parse(java.lang.String uri)
The provided value must match the origin-form request-target grammar production in RFC 7230, section 5.3.1.
uri
- URI pattern to parse.InvalidUriPatternException
- for invalid URI patterns.public java.util.Map<java.lang.String,java.lang.String> getQueryLiterals()
public java.util.Optional<java.lang.String> getQueryLiteralValue(java.lang.String parameter)
parameter
- Case-sensitive name of the parameter to retrieve.public boolean conflictsWith(UriPattern otherPattern)
otherPattern
- SmithyPattern to check against.@Deprecated public java.util.List<Pair<SmithyPattern.Segment,SmithyPattern.Segment>> getConflictingLabelSegments(UriPattern otherPattern)
public boolean equals(java.lang.Object other)
equals
in class SmithyPattern
public int hashCode()
hashCode
in class SmithyPattern