Path

final case class Path

Path is an immutable representation of a urls path. Internally it stores each element of a path in a sequence of Segment. This allows for powerful compositional APIs.

Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def ++(other: Path): Path

Combines two paths together to create a new one. In the process it will remove all extra slashes from the final path, leaving only the ones that are at the ends.

Combines two paths together to create a new one. In the process it will remove all extra slashes from the final path, leaving only the ones that are at the ends.

def /(name: String): Path

Appends a segment at the end of the path. To append a trailing slash use an empty string.

Appends a segment at the end of the path. To append a trailing slash use an empty string.

def /:(name: String): Path

Prepends the path with the provided segment. To prepend a leading slash use an empty string.

Prepends the path with the provided segment. To prepend a leading slash use an empty string.

Appends a trailing slash to the path

Appends a trailing slash to the path

def concat(other: Path): Path

Named alias to ++ operator

Named alias to ++ operator

def drop(n: Int): Path

Drops segments from the beginning of the path.

Drops segments from the beginning of the path.

def dropLast(n: Int): Path

Drops segments from the end of the path.

Drops segments from the end of the path.

Drops the trailing slash if available

Drops the trailing slash if available

Encodes the current path into a valid string

Encodes the current path into a valid string

Returns a new path that contains only the inital segments, leaving the last segment.

Returns a new path that contains only the inital segments, leaving the last segment.

Checks if the path is equal to ""

Checks if the path is equal to ""

Checks if the path is equal to "/"

Checks if the path is equal to "/"

Returns a the last element of the path. If the path contains a trailing slash, None will be returned.

Returns a the last element of the path. If the path contains a trailing slash, None will be returned.

Returns the last segment of the path

Returns the last segment of the path

Checks if the path contains a leading slash.

Checks if the path contains a leading slash.

Checks if the path is not equal to ""

Checks if the path is not equal to ""

Creates a new path from this one with it's segments reversed.

Creates a new path from this one with it's segments reversed.

def startsWith(other: Path): Boolean

Checks if the path starts with the provided path

Checks if the path starts with the provided path

def take(n: Int): Path

Creates a new path with the provided n initial segments.

Creates a new path with the provided n initial segments.

override def toString: String
Definition Classes
Any

Checks if the path contains a trailing slash.

Checks if the path contains a trailing slash.

Inherited methods

Inherited from:
Product