Package edu.byu.hbll.box.internal.util
Class UriBuilder
- java.lang.Object
-
- edu.byu.hbll.box.internal.util.UriBuilder
-
public class UriBuilder extends Object
A uri builder.- Author:
- Charles Draper
-
-
Constructor Summary
Constructors Constructor Description UriBuilder(String uri)
Creates a newUriBuilder
based on the given uri.UriBuilder(URI uri)
Creates a newUriBuilder
based on the given uri.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URI
build()
Builds theURI
.UriBuilder
host(String host)
Sets the host.UriBuilder
path(String path)
Adds to the path.UriBuilder
port(int port)
Sets the port.UriBuilder
queryParam(String name, Object... value)
Adds query parameters to the uri.UriBuilder
scheme(String scheme)
Sets the scheme.
-
-
-
Constructor Detail
-
UriBuilder
public UriBuilder(URI uri)
Creates a newUriBuilder
based on the given uri.- Parameters:
uri
- the default uri
-
UriBuilder
public UriBuilder(String uri)
Creates a newUriBuilder
based on the given uri.- Parameters:
uri
- the default uri
-
-
Method Detail
-
scheme
public UriBuilder scheme(String scheme)
Sets the scheme.- Parameters:
scheme
- the scheme to set- Returns:
- this
-
host
public UriBuilder host(String host)
Sets the host.- Parameters:
host
- the host to set- Returns:
- this
-
port
public UriBuilder port(int port)
Sets the port.- Parameters:
port
- the port to set- Returns:
- this
-
path
public UriBuilder path(String path)
Adds to the path.- Parameters:
path
- the path to add- Returns:
- this
-
queryParam
public UriBuilder queryParam(String name, Object... value)
Adds query parameters to the uri.- Parameters:
name
- the name of the query parametervalue
- the value(s) to add- Returns:
- this
-
-