Package com.networknt.openapi
Interface NormalisedPath
-
- All Known Implementing Classes:
ApiNormalisedPath
public interface NormalisedPathA normalised representation of an API path.Normalised paths are devoid of path prefixes and contain a normalised starting/ending slash to make comparisons easier.
- Author:
- Steve Hu
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisParam(int index)Stringnormalised()Stringoriginal()StringparamName(int index)Stringpart(int index)List<String>parts()
-
-
-
Method Detail
-
part
String part(int index)
- Parameters:
index- position of part- Returns:
- The path part at the given index
- Throws:
IndexOutOfBoundsException- if the provided index is not a valid index
-
isParam
boolean isParam(int index)
- Parameters:
index- position of part- Returns:
- Whether the path part at the given index is a path param (e.g. "/my/{param}/")
- Throws:
IndexOutOfBoundsException- if the provided index is not a valid index
-
paramName
String paramName(int index)
- Parameters:
index- position of part- Returns:
- The parameter name of the path part at the given index, or
null - Throws:
IndexOutOfBoundsException- if the provided index is not a valid index
-
original
String original()
- Returns:
- The original, un-normalised path string
-
normalised
String normalised()
- Returns:
- The normalised path string, with prefixes removed and a standard treatment for leading/trailing slashed.
-
-