class Url
source · line 10public class Url internal constructor(
/**
* The normalized scheme, or None for a relative reference.
*/
public val scheme: String?,
/**
* The parsed authority when the reference contains one.
*/
public val authority: UrlAuthority?,
/**
* The percent-encoded path, retaining reserved characters as structural data.
*/
public val encodedPath: String,
/**
* The encoded query without the leading question mark; None differs from an empty query.
*/
public val encodedQuery: String?,
/**
* The encoded fragment without the leading hash; None differs from an empty fragment.
*/
public val encodedFragment: String?,
private val serialized: String
) : Equals<Url>, Compare<Url>, Hash, ToString
- Supertype
Equals<Url> - Supertype
Compare<Url> - Supertype
Hash - Supertype
ToString
An immutable URI/IRI reference. Parsing accepts relative references and non-HTTP schemes without network I/O. Equality and ordering use normalized ASCII serialization; parsing follows a strict profile without browser-style recovery.
function resolve
source · line 54public fun resolve(reference: String): Url
Resolves a relative reference against this URL using URI reference-resolution rules.
parameter reference
source · line 54reference: String
function toString
source · line 36public override fun toString(): String
- Overrides
toString
Returns the normalized ASCII URI serialization.
function compareTo
source · line 44public override operator fun compareTo(other: Url): Long
- Overrides
compareTo
Orders normalized ASCII serializations lexicographically.
parameter other
source · line 44other: Url
property encodedFragment
source · line 30public val encodedFragment: String?
get: public read-only
The encoded fragment without the leading hash; None differs from an empty fragment.
function resolve
source · line 58public fun resolve(reference: Url): Url
Resolves a relative reference against this URL using URI reference-resolution rules.
parameter reference
source · line 58reference: Url
property authority
source · line 18public val authority: UrlAuthority?
get: public read-only
The parsed authority when the reference contains one.
property scheme
source · line 14public val scheme: String?
get: public read-only
The normalized scheme, or None for a relative reference.
property encodedPath
source · line 22public val encodedPath: String
get: public read-only
The percent-encoded path, retaining reserved characters as structural data.
function queryParameters
source · line 120public fun queryParameters(): UrlQuery
Parses the encoded query as ordered parameters, with ordinary URI plus semantics.
property encodedQuery
source · line 26public val encodedQuery: String?
get: public read-only
The encoded query without the leading question mark; None differs from an empty query.
function equals
source · line 40public override operator fun equals(other: Url): Boolean
- Overrides
equals
Compares normalized ASCII serializations.
parameter other
source · line 40other: Url
function copy
source · line 62public fun copy(configure: UrlBuilder.() -> Unit = {}): Url
Configures a copy of these components and returns an independent immutable URL.
parameter configure
source · line 62configure: UrlBuilder.() -> Unit = {}
function toIriString
source · line 132public fun toIriString(): String
Returns a display-oriented IRI, retaining escapes for reserved characters such as encoded slashes.
function httpRequestTarget
source · line 92public fun httpRequestTarget(): String
Returns origin-form path and query, excluding user information and fragment.
function redacted
source · line 149public fun redacted(queryNames: List<String> = emptyList<String>()): String
Removes user information and masks values of the specified query names for presentation.
parameter queryNames
source · line 149queryNames: List<String> = emptyList<String>()
function httpOrigin
source · line 73public fun httpOrigin(): UrlOrigin
Validates an HTTP or HTTPS network target and computes its normalized host and effective port. Invalid DNS names, compatibility numeric addresses, port zero, and IPvFuture are rejected.
function httpAbsoluteTarget
source · line 112public fun httpAbsoluteTarget(): String
Returns the absolute HTTP request target for a proxy, excluding user information and fragment.
function hash
source · line 49public override fun hash(): Long
- Overrides
hash
Hashes the same normalized serialization used by equality.