Builder

class Builder

Helper class for building or manipulating URI references. Not safe for concurrent use.

An absolute hierarchical URI reference follows the pattern: <scheme>://<authority><absolute path>?<query>#<fragment>

Relative URI references (which are always hierarchical) follow one of two patterns: <relative or absolute path>?<query>#<fragment> or //<authority><absolute path>?<query>#<fragment>

An opaque URI follows this pattern: <scheme>:<opaque part>#<fragment>

Use Uri.buildUpon to obtain a builder representing an existing URI.

Constructors

Link copied to clipboard
fun Builder()

Functions

Link copied to clipboard
fun appendEncodedPath(newSegment: String?): Uri.Builder

Appends the given segment to the path.

Link copied to clipboard
fun appendPath(newSegment: String?): Uri.Builder

Encodes the given segment and appends it to the path.

Link copied to clipboard
fun appendQueryParameter(key: String, value: String?): Uri.Builder

Encodes the key and value and then appends the parameter to the query string.

Link copied to clipboard
fun authority(authority: String?): Uri.Builder

Encodes and sets the authority.

Link copied to clipboard
fun build(): Uri

Constructs a Uri with the current attributes.

Link copied to clipboard
fun clearQuery(): Uri.Builder

Clears the the previously set query.

Link copied to clipboard
fun encodedAuthority(authority: String?): Uri.Builder

Sets the previously encoded authority.

Link copied to clipboard
fun encodedFragment(fragment: String?): Uri.Builder

Sets the previously encoded fragment.

Link copied to clipboard
fun encodedOpaquePart(opaquePart: String?): Uri.Builder

Sets the previously encoded opaque scheme-specific-part.

Link copied to clipboard
fun encodedPath(path: String?): Uri.Builder

Sets the previously encoded path.

Link copied to clipboard
fun encodedQuery(query: String?): Uri.Builder

Sets the previously encoded query.

Link copied to clipboard
fun fragment(fragment: String?): Uri.Builder

Encodes and sets the fragment.

Link copied to clipboard
fun opaquePart(opaquePart: String?): Uri.Builder

Encodes and sets the given opaque scheme-specific-part.

Link copied to clipboard
fun path(path: String?): Uri.Builder

Sets the path. Leaves '/' characters intact but encodes others as necessary.

Link copied to clipboard
fun query(query: String?): Uri.Builder

Encodes and sets the query.

Link copied to clipboard
fun scheme(scheme: String?): Uri.Builder

Sets the scheme.

Link copied to clipboard
open override fun toString(): String