Class CmsPath


  • public class CmsPath
    extends java.lang.Object
    Simple data holder class which stores a path in a normalized form.

    This is mostly useful when using paths as map keys, when you are not sure if the paths you are processing have a trailing slash or not.

    The paths are stored in the form '/foo/bar/baz', i.e. they include a leading but no trailing slash, except in the case of the root path '/'.

    • Constructor Summary

      Constructors 
      Constructor Description
      CmsPath​(java.lang.String pathStr)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String asString()
      Gets the path as a string.
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CmsPath

        public CmsPath​(java.lang.String pathStr)
        Creates a new instance.
        Parameters:
        pathStr - the path string
    • Method Detail

      • asString

        public java.lang.String asString()
        Gets the path as a string.
        Returns:
        the path as a string.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()