Class PathLocationImpl

java.lang.Object
dev.webfx.platform.windowlocation.spi.impl.PathLocationImpl
All Implemented Interfaces:
PathLocation
Direct Known Subclasses:
BrowsingLocationImpl, PathStateLocationImpl

public class PathLocationImpl extends Object implements PathLocation
Author:
Bruno Salmon
  • Constructor Details

    • PathLocationImpl

      public PathLocationImpl(String path)
    • PathLocationImpl

      public PathLocationImpl(PathLocation pathLocation)
    • PathLocationImpl

      public PathLocationImpl(String pathname, String queryString, String fragment)
  • Method Details

    • getPathname

      public String getPathname()
      Description copied from interface: PathLocation
      A pathname is the portion of a URL that describes a hierarchical path, including the preceding /. For example, in http://example.com/the/path?the=query#thehash, /the/path is the pathname. It is synonymous with window.location.pathname in web browsers.
      Specified by:
      getPathname in interface PathLocation
      Returns:
      A String containing an initial '/' followed by the path of the URL
    • getQueryString

      public String getQueryString()
      Description copied from interface: PathLocation
      The queryString is the part of the URL after the '?'. This is often used for parameter passing.
      Specified by:
      getQueryString in interface PathLocation
      Returns:
      the queryString
    • getFragment

      public String getFragment()
      Description copied from interface: PathLocation
      The fragment is the part of the URL after the '#'. This is often used for parameter passing.
      Specified by:
      getFragment in interface PathLocation
      Returns:
      the fragment
    • equals

      public boolean equals(Object o)
      Implementing equals() and hashCode() so a location can be identified in the history from a path location. So we allow super classes and consider only the pathname, the queryString and the fragment.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object