Class RepoPath

    • Constructor Detail

      • RepoPath

        public RepoPath​(String path)
        Construct a Repo Path from a string. The string should separate the path segments with forward slashes, e.g. /my/repo/path.
        Parameters:
        path - The string representation of the path. If the initial leading forward slash is missing it will be assumed to be there.
      • RepoPath

        public RepoPath​(List<String> list)
        Construct a Repo Path from a List.
        Parameters:
        list - The list to create the repo path from. The list should not have any separators.
    • Method Detail

      • getParent

        public RepoPath getParent()
        Get the parent path of the current path.
        Returns:
        The parent path, or null if we are at the root and there is no further parent.
      • getSegmentCount

        public int getSegmentCount()
        Get the nubmer of segments in this path.
        Returns:
        The number of segments.
      • startsWith

        public boolean startsWith​(RepoPath otherPath)
        Check is this path starts with the other path.
        Parameters:
        otherPath - The other path to check against.
        Returns:
        If it starts with the other path or not.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object