Class Path


  • public class Path
    extends Object
    Class for building a URI with query params
    • Constructor Detail

      • Path

        public Path​(String url)
        construct a path
        Parameters:
        url - the URL
    • Method Detail

      • param

        public void param​(Map<String,​Object> params)
        replace path params designated with curley braces with a value
        Parameters:
        params - a map of param names and values
      • param

        public void param​(String name,
                          String value)
        replace a single path param by name
        Parameters:
        name - the name of the path param
        value - the value to replace it with
      • queryString

        public void queryString​(String name,
                                Collection<?> value)
        Add a query param. This will result in a query param per value
        Parameters:
        name - the name
        value - a collection of values
      • queryString

        public void queryString​(String name,
                                Object value)
        Add a query param
        Parameters:
        name - the name
        value - the value
      • queryString

        public void queryString​(Map<String,​Object> parameters)
        Add query params as a map of key/values
        Parameters:
        parameters - the params to add
      • rawPath

        public String rawPath()
        Returns:
        the full raw path
      • baseUrl

        public String baseUrl()
        Returns:
        the URL without the query string
      • getQueryString

        public String getQueryString()
        Returns:
        just the query string
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object