public interface UriBuilder
Modifier and Type | Method and Description |
---|---|
java.net.URI |
build()
The constructed URI.
|
java.net.URI |
expand(java.util.Map<java.lang.String,? super java.lang.Object> values)
Expands the URI if it is a template, using the given values.
|
UriBuilder |
fragment(java.lang.String fragment)
Sets the URI fragment.
|
UriBuilder |
host(java.lang.String host)
Sets the URI host.
|
static UriBuilder |
of(java.lang.CharSequence uri)
Create a
UriBuilder with the given base URI as a starting point. |
static UriBuilder |
of(java.net.URI uri)
Create a
UriBuilder with the given base URI as a starting point. |
UriBuilder |
path(java.lang.String path)
Appends the given path to the existing path correctly handling '/'.
|
UriBuilder |
port(int port)
Sets the URI port.
|
UriBuilder |
queryParam(java.lang.String name,
java.lang.Object... values)
Adds a query parameter for the give name and values.
|
UriBuilder |
replacePath(java.lang.String path)
Replaces the existing path if any.
|
UriBuilder |
replaceQueryParam(java.lang.String name,
java.lang.Object... values)
Adds a query parameter for the give name and values.
|
UriBuilder |
scheme(java.lang.String scheme)
Sets the URI scheme.
|
UriBuilder |
userInfo(java.lang.String userInfo)
Sets the URI user info.
|
@NonNull UriBuilder fragment(@Nullable java.lang.String fragment)
fragment
- The fragument@NonNull UriBuilder scheme(@Nullable java.lang.String scheme)
scheme
- The scheme@NonNull UriBuilder userInfo(@Nullable java.lang.String userInfo)
userInfo
- The use info@NonNull UriBuilder host(@Nullable java.lang.String host)
host
- The host to use@NonNull UriBuilder port(int port)
port
- The port to use@NonNull UriBuilder path(@Nullable java.lang.String path)
path
- The path@NonNull UriBuilder replacePath(@Nullable java.lang.String path)
path
- The path@NonNull UriBuilder queryParam(java.lang.String name, java.lang.Object... values)
name
- The namevalues
- The values@NonNull UriBuilder replaceQueryParam(java.lang.String name, java.lang.Object... values)
name
- The namevalues
- The values@NonNull java.net.URI build()
UriSyntaxException
- if the URI to be constructed is invalid@NonNull java.net.URI expand(java.util.Map<java.lang.String,? super java.lang.Object> values)
values
- Expands the URI with the given values.@NonNull static UriBuilder of(@NonNull java.net.URI uri)
UriBuilder
with the given base URI as a starting point.uri
- The URI@NonNull static UriBuilder of(@NonNull java.lang.CharSequence uri)
UriBuilder
with the given base URI as a starting point.uri
- The URI