Interface UrlBuilder


public interface UrlBuilder
Build a URL typically using a base url and adding path and query parameters.
  • Method Details

    • enc

      static String enc(String val)
      URL encode the value.
    • of

      static UrlBuilder of(String baseUrl)
      Create a UrlBuilder with a base url.
    • url

      UrlBuilder url(String url)
      Set the url. This effectively replaces a base url.
    • path

      UrlBuilder path(String path)
      Add a path segment to the url.

      This includes appending a "/" prefix with the path.

    • path

      UrlBuilder path(int val)
      Add a path segment to the url.
    • path

      UrlBuilder path(long val)
      Add a path segment to the url.
    • path

      UrlBuilder path(Object val)
      Add a path segment to the url.
    • queryParam

      UrlBuilder queryParam(String name, String value)
      Append a query parameter.

      The name and value parameters are url encoded.

    • queryParam

      UrlBuilder queryParam(String name, Object value)
      Append a query parameter.

      The name and value parameters are url encoded.

    • queryParam

      UrlBuilder queryParam(Map<String,?> params)
      Append a query parameters.
    • matrixParam

      UrlBuilder matrixParam(String name, String value)
      Append a matrix parameter.

      The name and value parameters are url encoded.

    • matrixParam

      UrlBuilder matrixParam(String name, Object value)
      Append a matrix parameter.

      The name and value parameters are url encoded.

    • build

      String build()
      Return the full URL.