UrlWithAuthority

io.lemonlabs.uri.UrlWithAuthority
See theUrlWithAuthority companion object
sealed trait UrlWithAuthority extends Url

Represents absolute URLs with an authority (i.e. URLs with a host), examples include:

  •      Absolute URL: `http://example.com`
    
  • Protocol Relative URL: //example.com

Attributes

Companion:
object
Graph
Supertypes
trait Url
trait Uri
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Known subtypes

Members list

Concise view

Value members

Abstract methods

Concrete methods

def host: Host
def hostOption: Option[Host]
def longestSubdomain: Option[String]

Returns the longest subdomain for this URL's host. E.g. for http://a.b.c.example.com returns a.b.c.example

Returns the longest subdomain for this URL's host. E.g. for http://a.b.c.example.com returns a.b.c.example

Attributes

Returns:

the longest subdomain for this URL's host

override def mapPassword(f: String => String): Self

Transforms this URL by applying the specified Function to the password if it exists

Transforms this URL by applying the specified Function to the password if it exists

Attributes

Definition Classes
override def mapUser(f: String => String): Self

Transforms this URL by applying the specified Function to the user if it exists

Transforms this URL by applying the specified Function to the user if it exists

Attributes

Definition Classes
def password: Option[String]
def port: Option[Int]
def publicSuffix: Option[String]

Returns the longest public suffix for the host in this URI. Examples include: com for www.example.com co.uk for www.example.co.uk

Returns the longest public suffix for the host in this URI. Examples include: com for www.example.com co.uk for www.example.co.uk

Attributes

Returns:

the longest public suffix for the host in this URI

def publicSuffixes: Vector[String]

Returns all longest public suffixes for the host in this URI. Examples include: com for www.example.com co.uk and uk for www.example.co.uk

Returns all longest public suffixes for the host in this URI. Examples include: com for www.example.com co.uk and uk for www.example.co.uk

Attributes

Returns:

all public suffixes for the host in this URI

Removes any password from this URL

Removes any password from this URL

Attributes

Returns:

This URL without the password

Removes any user from this URL

Removes any user from this URL

Attributes

Returns:

This URL without the user

def shortestSubdomain: Option[String]

Returns the shortest subdomain for this URL's host. E.g. for http://a.b.c.example.com returns a

Returns the shortest subdomain for this URL's host. E.g. for http://a.b.c.example.com returns a

Attributes

Returns:

the shortest subdomain for this URL's host

def subdomain: Option[String]

Returns the second largest subdomain for this URL's host.

Returns the second largest subdomain for this URL's host.

E.g. for http://a.b.c.example.com returns a.b.c

Note: In the event there is only one subdomain (i.e. the host is the apex domain), this method returns None. E.g. This method will return None for http://example.com.

Attributes

Returns:

the second largest subdomain for this URL's host

def subdomains: Vector[String]

Returns all subdomains for this URL's host. E.g. for http://a.b.c.example.com returns a, a.b, a.b.c and a.b.c.example

Returns all subdomains for this URL's host. E.g. for http://a.b.c.example.com returns a, a.b, a.b.c and a.b.c.example

Attributes

Returns:

all subdomains for this URL's host

override def toStringPunycode: String

Attributes

Returns:

the URL as a String. If the URI has a domain name for a host, any unicode characters will be returned in ASCII Compatible Encoding (ACE), as defined by the ToASCII operation of RFC 3490.

Definition Classes
def user: Option[String]
def userInfo: Option[UserInfo]
def withHost(host: Host): Self

Copies this Url but with the host set as the given value.

Copies this Url but with the host set as the given value.

Attributes

host

the new host to set

Returns:

a new Url with the specified host

def withPassword(password: String): Self

Copies this Url but with the password set as the given value.

Copies this Url but with the password set as the given value.

Attributes

password

the new password to set

Returns:

a new Url with the specified password

def withPort(port: Int): Self

Copies this Url but with the port set as the given value.

Copies this Url but with the port set as the given value.

Attributes

port

the new port to set

Returns:

a new Url with the specified port

def withUser(user: String): Self

Copies this Url but with the user set as the given value.

Copies this Url but with the user set as the given value.

Attributes

user

the new user to set

Returns:

a new Url with the specified user

def withUserInfo(ui: Option[UserInfo]): Self

Inherited methods

def addParam[K : QueryKey, V : QueryValue](k: K, v: V): Self

Adds a new Query String parameter key-value pair.

Adds a new Query String parameter key-value pair.

Pairs with values, such as Some("value"), represent query params with values, i.e ?param=value

By default, pairs without values, i.e None, represent query params without values, i.e ?param Using a UriConfig(renderQuery = ExcludeNones), will cause pairs with None values not to be rendered

Attributes

k

value that provides a name pair for the parameter. Can be a any basic value type or a custom type if you provide a QueryKey type-class

v

value that provides a value for the parameter. Can be a any basic value type or a custom type if you provide a QueryValue type-class

Returns:

A new Url with the new Query String parameter

Inherited from:
Url
def addParam[A : QueryKeyValue](a: A): Self

Adds a new Query String parameter key-value pair.

Adds a new Query String parameter key-value pair.

Pairs with values, such as Some("value"), represent query params with values, i.e ?param=value

By default, pairs without values, i.e None, represent query params without values, i.e ?param Using a UriConfig(renderQuery = ExcludeNones), will cause pairs with None values not to be rendered

Attributes

a

value that provides a name/value pair for the parameter. Can be a Tuple of any basic value types or a custom type if you provide a QueryKeyValue type-class

Returns:

A new Url with the new Query String parameter

Inherited from:
Url
def addParams[KV : QueryKeyValue](first: KV, second: KV, params: KV*): Self

Adds all the specified key-value pairs as parameters to the query

Adds all the specified key-value pairs as parameters to the query

Attributes

params

A list of key-value pairs to add as query parameters

Returns:

A new Url with the new Query String parameters

Inherited from:
Url
def addParams[A : TraversableParams](params: A): Self

Adds all the specified key-value pairs as parameters to the query

Adds all the specified key-value pairs as parameters to the query

Attributes

params

A list of key-value pairs to add as query parameters

Returns:

A new Url with the new Query String parameters

Inherited from:
Url
def addPathPart[P : PathPart](part: P): Self

Attributes

Inherited from:
Url
def addPathParts[P : PathPart](first: P, second: P, parts: P*): Self

Attributes

Inherited from:
Url

Attributes

Inherited from:
Url
def apexDomain: Option[String]

Returns the apex domain for this URL.

Returns the apex domain for this URL.

The apex domain is constructed from the public suffix for this URL's host prepended with the immediately preceding dot segment.

Examples include: example.com for www.example.com example.co.uk for www.example.co.uk

Attributes

Returns:

the apex domain for this URL

Inherited from:
Url
def canEqual(that: Any): Boolean

Attributes

Inherited from:
Equals
def collectQuery[KV : QueryKeyValue](f: PartialFunction[(String, Option[String]), KV]): Self

Transforms the Query String by applying the specified PartialFunction to each Query String Parameter

Transforms the Query String by applying the specified PartialFunction to each Query String Parameter

Parameters not defined in the PartialFunction will be removed.

Attributes

f

A function that returns a new Parameter when applied to each Parameter

Inherited from:
Url
def equalsUnordered(other: Uri): Boolean

Similar to == but ignores the ordering of any query string parameters

Similar to == but ignores the ordering of any query string parameters

Attributes

Inherited from:
Url
def filterQuery(f: ((String, Option[String])) => Boolean): Self

Removes any Query String Parameters that return false when applied to the given Function

Removes any Query String Parameters that return false when applied to the given Function

Attributes

Inherited from:
Url
def filterQueryNames(f: String => Boolean): Self

Removes any Query String Parameters that return false when their name is applied to the given Function

Removes any Query String Parameters that return false when their name is applied to the given Function

Attributes

Inherited from:
Url
def filterQueryValues(f: String => Boolean): Self

Removes any Query String Parameters that return false when their value is applied to the given Function

Removes any Query String Parameters that return false when their value is applied to the given Function

Attributes

Inherited from:
Url
def flatMapQuery[A : TraversableParams](f: ((String, Option[String])) => A): Self

Transforms the Query String by applying the specified Function to each Query String Parameter

Transforms the Query String by applying the specified Function to each Query String Parameter

Attributes

f

A function that returns a collection of Parameters when applied to each parameter

Inherited from:
Url
def fragment: Option[String]

Attributes

Inherited from:
Url
def mapQuery[KV : QueryKeyValue](f: PartialFunction[(String, Option[String]), KV]): Self

Transforms the Query String by applying the specified PartialFunction to each Query String Parameter

Transforms the Query String by applying the specified PartialFunction to each Query String Parameter

Parameters not defined in the PartialFunction will be left as-is.

Attributes

f

A function that returns a new Parameter when applied to each Parameter

Inherited from:
Url
def mapQueryNames[K : QueryKey](f: String => K): Self

Transforms the Query String by applying the specified Function to each Query String Parameter name

Transforms the Query String by applying the specified Function to each Query String Parameter name

Attributes

f

A function that returns a new Parameter name when applied to each Parameter name

Inherited from:
Url
def mapQueryValues[V : QueryValue](f: String => V): Self

Transforms the Query String by applying the specified Function to each Query String Parameter value

Transforms the Query String by applying the specified Function to each Query String Parameter value

Attributes

f

A function that returns a new Parameter value when applied to each Parameter value

Inherited from:
Url
def normalize(removeEmptyPathParts: Boolean, slashTermination: SlashTermination): Self

Normalizes this

Normalizes this

Attributes

Inherited from:
Url

Attributes

Inherited from:
Url
def productArity: Int

Attributes

Inherited from:
Product
def productElement(n: Int): Any

Attributes

Inherited from:
Product
def productElementName(n: Int): String

Attributes

Inherited from:
Product
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def productPrefix: String

Attributes

Inherited from:
Product

Attributes

Inherited from:
Url

Attributes

Inherited from:
Url
def removeParams[K : QueryKey](k: Iterable[K]): Self

Removes all Query String parameters with a name in the specified list

Removes all Query String parameters with a name in the specified list

Attributes

k

Names of Query String parameter(s) to remove

Inherited from:
Url
def removeParams[K : QueryKey](first: K, second: K, rest: K*): Self

Removes all Query String parameters with a name in the specified list

Removes all Query String parameters with a name in the specified list

Attributes

first

Name of a Query String parameter to remove

rest

Name of more Query String parameter(s) to remove

second

Name of another Query String parameter to remove

Inherited from:
Url
def removeParams[K : QueryKey](k: K): Self

Removes all Query String parameters with the specified key

Removes all Query String parameters with the specified key

Attributes

k

Key for the Query String parameter(s) to remove

Inherited from:
Url

Removes all Query String parameters

Removes all Query String parameters

Attributes

Inherited from:
Url
def replaceParams[K : QueryKey, V : QueryValue](k: K, v: V): Self

Replaces the all existing Query String parameters with the specified key with a single Query String parameter with the specified value.

Replaces the all existing Query String parameters with the specified key with a single Query String parameter with the specified value.

Pairs with values, such as ("param", Some("value")), represent query params with values, i.e ?param=value

By default, pairs without values, such as ("param", None), represent query params without values, i.e ?param Using a UriConfig(renderQuery = ExcludeNones), will cause pairs with None values not to be rendered

Attributes

k

Key for the Query String parameter(s) to replace

v

value to replace with

Returns:

A new Uri with the result of the replace

Inherited from:
Url
def resolve(base: UrlWithScheme, strict: Boolean): UrlWithScheme

Attributes

Returns:

this URL resolved with the given URL as the base according to section 5.2.2 Transform References of RFC 3986.

Inherited from:
Url
def schemeOption: Option[String]

Attributes

Inherited from:
Uri
def slashTerminated(slashTermination: SlashTermination): Self

Attributes

Inherited from:
Url

Attributes

Inherited from:
Url
def toJavaURI: URI

Converts to a java.net.URI

Converts to a java.net.URI

This involves a toString and URI.parse because the specific java.net.URI constructors do not deal properly with encoded elements

Attributes

Returns:

a java.net.URI matching this io.lemonlabs.uri.Uri

Inherited from:
Uri

Attributes

Inherited from:
Url
def toRedactedString(redactor: Redactor)(implicit conf: UriConfig): String

Attributes

Inherited from:
Url

Attributes

Inherited from:
Url
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Uri -> Any
Inherited from:
Uri
def toStringRaw: String

Returns the path with no encoders taking place (e.g. non ASCII characters will not be percent encoded)

Returns the path with no encoders taking place (e.g. non ASCII characters will not be percent encoded)

Attributes

Returns:

String containing the raw path for this Uri

Inherited from:
Uri
def toUrl: Url

Attributes

Inherited from:
Url
def toUrn: Urn

Attributes

Inherited from:
Url

Copies this Url but with the authority set as the given value.

Copies this Url but with the authority set as the given value.

Attributes

authority

the authority to set

Returns:

a new Url with the specified authority

Inherited from:
Url
def withConfig(config: UriConfig): Self

Copies this Uri but with a new UriConfig

Copies this Uri but with a new UriConfig

Attributes

config

the new config to use

Returns:

a new Uri with the specified config

Inherited from:
Uri
def withFragment[T : Fragment](fragment: T): Self

Copies this Url but with the fragment set as the given value.

Copies this Url but with the fragment set as the given value.

Attributes

fragment

the new fragment to set

Returns:

a new Url with the specified fragment

Inherited from:
Url
def withHost(host: String): SelfWithAuthority

Copies this Url but with the host set as the given value.

Copies this Url but with the host set as the given value.

Attributes

host

the new host to set

Returns:

a new Url with the specified host

Inherited from:
Url
def withPath(path: UrlPath): Self

Copies this Url but with the path set as the given value.

Copies this Url but with the path set as the given value.

Attributes

path

the new path to set

Returns:

a new Url with the specified path

Inherited from:
Url

Copies this Url but with the path set as the given value.

Copies this Url but with the path set as the given value.

Attributes

parts

the parts that make up the new path

Returns:

a new Url with the specified path

Inherited from:
Url
def withQueryString[KV : QueryKeyValue](first: KV, second: KV, params: KV*): Self

Replaces the all existing Query String parameters with a new set of query params

Replaces the all existing Query String parameters with a new set of query params

Attributes

Inherited from:
Url

Replaces the all existing Query String parameters with a new set of query params

Replaces the all existing Query String parameters with a new set of query params

Attributes

Inherited from:
Url

Copies this Url but with the query set as the given value.

Copies this Url but with the query set as the given value.

Attributes

query

the new QueryString to set

Returns:

a new Url with the specified query

Inherited from:
Url
def withScheme(scheme: String): SelfWithScheme

Copies this Uri but with the scheme set as the given value.

Copies this Uri but with the scheme set as the given value.

Attributes

scheme

the new scheme to set

Returns:

a new Uri with the specified scheme

Inherited from:
Uri

Implicits

Inherited implicits

implicit def config: UriConfig

Attributes

Inherited from:
Uri