Represents a URI Authority part (user, password, host and port)

By: Stéphane Épardaud

no subtypes hierarchy

Initializer
Authority(String? user = null, String? password = null, String? host = null, Integer? port = null, Boolean ipLiteral = false)
Parameters:
  • user = null

    The optional user

  • password = null

    The optional password

  • host = null

    The optional host

  • port = null

    The optional port number

  • ipLiteral = false

    True if the host name is an ipLiteral (IPV6 or later) and has to be represented surrounded by [] (square brackets)

Attributes
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.

In general, hash values vary between platforms and between executions of the same program.

Note that when executing on a Java Virtual Machine, the 64-bit Integer value returned by an implementation of hash is truncated to a 32-bit integer value by taking the exclusive disjunction of the 32 lowest-order bits with the 32 highest-order bits, before returning the value to the caller.

Refines Identifiable.hash ultimately refines Object.hash
hostSource Codeshared String? host

The optional host

humanRepresentationSource Codeshared String humanRepresentation

Returns a human (non parseable) representation of this part

ipLiteralSource Codeshared Boolean ipLiteral

True if the host name is an ipLiteral (IPV6 or later) and has to be represented surrounded by [] (square brackets)

passwordSource Codeshared String? password

The optional password

portSource Codeshared Integer? port

The optional port number

specifiedSource Codeshared Boolean specified

Returns true if the authority part is present (if the host is not null)

stringSource Codeshared actual String string

Returns an externalisable (percent-encoded) representation of this part

userSource Codeshared String? user

The optional user

Inherited Attributes
Attributes inherited from: Object
Methods
equalsSource Codeshared actual Boolean equals(Object that)

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

Refines Identifiable.equals ultimately refines Object.equals
toRepresentationSource Codeshared String toRepresentation(Boolean human)

Returns either an externalisable (percent-encoded) or human (non parseable) representation of this part

withSource Codeshared Authority with(String? user = ..., String? password = ..., String? host = ..., Integer? port = ..., Boolean ipLiteral = ...)

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

Parameters:
  • user = this.user
  • password = this.password
  • host = this.host
  • port = this.port
  • ipLiteral = this.ipLiteral
withHostSource Codeshared Authority withHost(String? host, Boolean ipLiteral = false)

Create a new Authority based on this Authority, replacing the host and ipLiteral with the given values

Parameters:
  • ipLiteral = false
withPasswordSource Codeshared Authority withPassword(String? password)

Create a new Authority based on this Authority, replacing the password with the given value

withPortSource Codeshared Authority withPort(Integer? port)

Create a new Authority based on this Authority, replacing the port with the given value

withUserSource Codeshared Authority withUser(String? user)

Create a new Authority based on this Authority, replacing the user with the given value

Inherited Methods
Methods inherited from: Object