The URI class. See RCF 3986 for specifications.

By: Stéphane Épardaud
  • Uri
    • Basic
      • Identifiable
      • Object
        • Anything

no subtypes hierarchy

Initializer
Uri(String? scheme = null, Authority authority = ..., Path path = ..., Query query = ..., String? fragment = null)
Parameters:
  • scheme = null

    The optional URI scheme: http, https, mailto

  • authority = defaultAuthority

    The optional Authority part (contains user, password, host and port)

  • path = defaultPath

    The optional Path part

  • query = defaultQuery

    The optional query part

  • fragment = null

    The optional fragment (hash) part

Attributes
authorityshared Authority authority

The optional Authority part (contains user, password, host and port)

fragmentshared String? fragment

The optional fragment (hash) part

hashshared actual Integer hash

The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that:

  • if x==y then x.hash==y.hash.

Therefore, a class which refines equals must also refine hash.

Because the Integer type is platform-dependent a compiler for a given platform is permitted to further manipulate the calculated hash for an object, and the resulting hash may differ between platforms.

Refines Identifiable.hash (hash) ultimately refines Object.hash (hash)
humanRepresentationshared String humanRepresentation

Returns a human (not parseable) representation of this URI.

pathshared Path path

The optional Path part

pathPartshared String pathPart

Returns the path as an externalisable (percent-encoded) string representation. Can be an empty string.

queryshared Query query

The optional query part

queryPartshared String? queryPart

Returns the query as an externalisable (percent-encoded) string representation. Can be null.

relativeshared Boolean relative

Returns true if this is a relative URI

schemeshared String? scheme

The optional URI scheme: http, https, mailto

stringshared actual String string

Returns an externalisable (percent-encoded) representation of this URI.

Refines Object.string (string)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
equalsshared actual Boolean equals(Object that)

Returns true if the given object is the same as this object

Refines Identifiable.equals (equals) ultimately refines Object.equals (equals)
getshared Request get()

Returns a GET HTTP request

withshared Uri with(String? scheme = ..., Authority authority = ..., Path path = ..., Query query = ..., String? fragment = ...)

Create a new Uri based on this Uri, replacing the specified values

Parameters:
  • scheme = this.scheme
  • authority = this.authority
  • path = this.path
  • query = this.query
  • fragment = this.fragment
withAuthorityshared Uri withAuthority(Authority authority)

Create a new Uri based on this Uri, replacing the authority with the given value

withFragmentshared Uri withFragment(String? fragment)

Create a new Uri based on this Uri, replacing the fragment with the given value

withPathshared Uri withPath(Path path)

Create a new Uri based on this Uri, replacing the path with the given value

withQueryshared Uri withQuery(Query query)

Create a new Uri based on this Uri, replacing the query with the given value

withSchemeshared Uri withScheme(String? scheme)

Create a new Uri based on this Uri, replacing the scheme with the given value

Inherited Methods
Methods inherited from: Object
equals