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
authoritySource Codeshared Authority authority

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

fragmentSource Codeshared String? fragment

The optional fragment (hash) part

hashSource Codeshared 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)
humanRepresentationSource Codeshared String humanRepresentation

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

pathSource Codeshared Path path

The optional Path part

pathPartSource Codeshared String pathPart

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

querySource Codeshared Query query

The optional query part

queryPartSource Codeshared String? queryPart

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

relativeSource Codeshared Boolean relative

Returns true if this is a relative URI

schemeSource Codeshared String? scheme

The optional URI scheme: http, https, mailto

stringSource Codeshared 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
equalsSource Codeshared 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)
getSource Codeshared Request get()

Returns a GET HTTP request

withSource Codeshared 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
withAuthoritySource Codeshared Uri withAuthority(Authority authority)

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

withFragmentSource Codeshared Uri withFragment(String? fragment)

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

withPathSource Codeshared Uri withPath(Path path)

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

withQuerySource Codeshared Uri withQuery(Query query)

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

withSchemeSource Codeshared 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