uk.co.bigbeeconsultants.http.url

Href

case class Href(endpoint: Option[Endpoint], path: Path = Path.empty, fragment: Option[String] = scala.None, query: Option[String] = scala.None) extends Product with Serializable

Provides a utility wrapper for URLs that splits them into their component parts and allows alteration and reassembly with different components. Instances may be relative URLs.

Use the case-class 'copy' method to alter components.

This class broadly supports the URL part of RFC-3986 http://tools.ietf.org/html/rfc3986.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Href
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Href(endpoint: Option[Endpoint], path: Path = Path.empty, fragment: Option[String] = scala.None, query: Option[String] = scala.None)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. lazy val asURL: URL

    Converts this instance to a java.

    Converts this instance to a java.net.URL if possible. This will succeed if isURL would return true.

    Exceptions thrown
    MalformedURLException

    if some of the necessary information is missing, i.e. this instance is relative.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. val endpoint: Option[Endpoint]

  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def extension: Option[String]

    Gets the extension of the last path segment, if any.

  12. def file: Option[String]

    Gets the last path segment, if any.

  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. val fragment: Option[String]

  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def hostAndPort: Option[String]

    Gets the host and port parts as a string.

    Gets the host and port parts as a string. E.g. "localhost:8080"

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def isURL: Boolean

    Tests whether this instance is convertible to an absolute URL.

  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. val path: Path

  23. def pathString: String

    Gets the path concatenated with the fragment identifier (if any) and the query parameters (if any).

  24. val query: Option[String]

  25. def queryMap: Map[String, String]

    Extracts the parts of the query string as a map of strings.

    Extracts the parts of the query string as a map of strings. This does not allow for duplicate keys, which is a legitimate situation in query strings. So this method is only useful in particular use-cases where this cannot happen, Otherwise, use the more-general method queryParts.

    If the query string is absent, an empty map is returned.

  26. def queryParts: List[(String, String)]

    Extracts the parts of the query string as a list of tuples.

    Extracts the parts of the query string as a list of tuples. This allows for duplicate keys, which is a legitimate situation in query strings. If a particular use-case requires that this /cannot/ happen, the other method queryMap may be simpler to use.

    If the query string is absent, an empty list is returned.

  27. def startsWith(other: Href): Boolean

    Tests whether this instances starts with another instance.

    Tests whether this instances starts with another instance. This is true if both endpoints are the same (possibly None) and this path starts with the other path.

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toPartialURL: PartialURL

  30. def toString(): String

    Definition Classes
    Href → AnyRef → Any
  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  34. def withQuery(params: Map[String, String]): Href

    Creates a new instance, replacing any query string with a new one formed from a map of key/values pairs.

    Creates a new instance, replacing any query string with a new one formed from a map of key/values pairs. The parts of the query string will be URL-encoded automatically. The supplied parameter map may be empty, indicating there is no query string.

    This method provides an alternative to use using copy to change the queryfield.

  35. def withQueryList(params: List[(String, String)]): Href

    Creates a new instance, replacing any query string with a new one formed from a list of key/values pairs.

    Creates a new instance, replacing any query string with a new one formed from a list of key/values pairs. The parts of the query string will be URL-encoded automatically. The supplied parameter list may be empty, indicating there is no query string.

    This method provides an alternative to use using copy to change the queryfield.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped