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