Interface URIBuilder

All Superinterfaces:
RelativeURIBuilder

public interface URIBuilder extends RelativeURIBuilder
Builder for a URI.
Author:
Paul Ferraro
  • Method Details

    • setScheme

      URIBuilder setScheme(String scheme)
      Specifies the scheme of URI created by this builder. If unspecified, "http" is used.
      Parameters:
      scheme - a URI schema
      Returns:
      a reference to this builder
    • setUserInfo

      URIBuilder setUserInfo(String userInfo)
      Specifies the user info of URI created by this builder.
      Parameters:
      userInfo - user info
      Returns:
      a reference to this builder
    • setHost

      URIBuilder setHost(String host)
      Specifies the host of the URI created by this builder. If unspecified, the loopback address of the host machine is used.
      Parameters:
      host - a URI host
      Returns:
      a reference to this builder
    • setPort

      URIBuilder setPort(int port)
      Specifies the port of the URI created by this builder. If unspecified, the URI will use the default port for the specified scheme.
      Parameters:
      port - a URI port
      Returns:
      a reference to this builder
    • addPath

      default URIBuilder addPath(String path)
      Description copied from interface: RelativeURIBuilder
      Appends the specified path to the URI created by this builder.
      Specified by:
      addPath in interface RelativeURIBuilder
      Parameters:
      path - a URI path
      Returns:
      a reference to this builder
    • addPath

      URIBuilder addPath(String path, Map<String,String> parameters)
      Description copied from interface: RelativeURIBuilder
      Appends the specified path and path parameters to the URI created by this builder.
      Specified by:
      addPath in interface RelativeURIBuilder
      Parameters:
      path - a URI path
      parameters - the path parameters for the specified path
      Returns:
      a reference to this builder
    • addParameter

      default URIBuilder addParameter(String parameterName, String parameterValue)
      Description copied from interface: RelativeURIBuilder
      Appends the specified query parameter to the URI created by this builder.
      Specified by:
      addParameter in interface RelativeURIBuilder
      Parameters:
      parameterName - a query parameter name
      parameterValue - a query parameter name
      Returns:
      a reference to this builder
    • addParameters

      default URIBuilder addParameters(Map<String,String> parameters)
      Description copied from interface: RelativeURIBuilder
      Appends the specified query parameters to the URI created by this builder.
      Specified by:
      addParameters in interface RelativeURIBuilder
      Parameters:
      parameters - a map of query parameters
      Returns:
      a reference to this builder
    • setFragment

      URIBuilder setFragment(String fragment)
      Description copied from interface: RelativeURIBuilder
      Specifies the fragment (e.g. anchor) of the URI created by this builder.
      Specified by:
      setFragment in interface RelativeURIBuilder
      Parameters:
      fragment - a URI fragment
      Returns:
      a reference to this builder
    • of

      static URIBuilder of()
      Returns a URI builder using default scheme ports.
      Returns:
      a URI builder using default scheme ports.
    • of

      static URIBuilder of(ToIntFunction<String> defaultPort)
      Returns a URI builder using the specified default port function.
      Parameters:
      defaultPort - a function that determines the default port for a given scheme.
      Returns:
      a URI builder using the specified default port function.