Interface NormalisedPath

  • All Known Implementing Classes:
    ApiNormalisedPath

    public interface NormalisedPath
    A 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 Detail

      • parts

        List<String> parts()
        Returns:
        The path parts from the normalised path
      • 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.