Class ApiPathImpl
java.lang.Object
com.atlassian.oai.validator.model.NormalisedPathImpl
com.atlassian.oai.validator.model.ApiPathImpl
- All Implemented Interfaces:
ApiPath,NormalisedPath
-
Constructor Summary
ConstructorsConstructorDescriptionApiPathImpl(String path, String apiPrefix) ApiPathImpl(String path, String apiPrefix, boolean strictPathMatching) -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasParams(int index) booleanmatches(NormalisedPath requestPath) Determine if the given request path matches this API path, taking into consideration path params.paramNames(int index) paramValues(int index, String requestPathPart) Extract the param values for each param in the indexed path part, extracted from the given request path part.booleanpartMatches(int index, String requestPathPart) Determine if the given request path part matches against the corresponding path part in this API path, taking into consideration path params.Methods inherited from class com.atlassian.oai.validator.model.NormalisedPathImpl
normalised, numberOfParts, original, partMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.oai.validator.model.NormalisedPath
normalised, numberOfParts, original, part
-
Constructor Details
-
ApiPathImpl
-
ApiPathImpl
- Parameters:
strictPathMatching- If true, a trailing slash indicates a different path than without.
-
-
Method Details
-
matches
Description copied from interface:ApiPathDetermine if the given request path matches this API path, taking into consideration path params.Note that this method does not validate path params in the incoming request path part - it merely indicates that it matches the template described in the API path expression.
-
partMatches
Description copied from interface:ApiPathDetermine if the given request path part matches against the corresponding path part in this API path, taking into consideration path params.Note that this method does not validate path params in the incoming request path part - it merely indicates that it matches the template described in the API path expression.
- Specified by:
partMatchesin interfaceApiPath- Parameters:
index- The path part index to comparerequestPathPart- The request path part to match- Returns:
- true if the incoming request path part matches against the template defined in this API path; false otherwise.
-
hasParams
public boolean hasParams(int index) -
paramNames
- Specified by:
paramNamesin interfaceApiPath- Returns:
- The parameter name(s) in the path part at the given index, or an empty list if the given part does not have a parameter. Parameter names are returned in order.
-
paramValues
Description copied from interface:ApiPathExtract the param values for each param in the indexed path part, extracted from the given request path part.- Specified by:
paramValuesin interfaceApiPath- Parameters:
index- The index of the path part to extract templated params withrequestPathPart- The request path part to extract param values from- Returns:
- The (name, value) for each path param in the given part. If the param could not be found, will be empty.
-