Path is an immutable representation of the path of a URL. Internally it stores each element of a path in a sequence of text, together with flags on whether there are leading and trailing slashes in the path. This allows for a combination of precision and performance and supports a rich API.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
Members list
Value members
Concrete methods
Combines two paths together to create a new one, having a leading slash if only the left path has a leading slash, and a trailing slash if only the right path has a trailing slash. Note that if you concat the empty path to any other path, either on the left or right hand side, you get back that same path unmodified.
Combines two paths together to create a new one, having a leading slash if only the left path has a leading slash, and a trailing slash if only the right path has a trailing slash. Note that if you concat the empty path to any other path, either on the left or right hand side, you get back that same path unmodified.
Attributes
Appends a segment at the end of the path.
Appends a segment at the end of the path.
If there is already a trailing slash when you append a segment, then the trailing slash will be removed (more precisely, it becomes the slash that separates the existing path from the new segment).
Attributes
Prepends the path with the provided segment.
Prepends the path with the provided segment.
If there is already a leading slash when you prepend a segment, then the leading slash will be removed (more precisely, it becomes the slash that separates the new segment from the existing path).
Attributes
Prepends a leading slash to the path.
Prepends a leading slash to the path.
Attributes
Appends a trailing slash to the path.
Appends a trailing slash to the path.
Attributes
Drops the first n segments from the path, treating both leading and trailing slashes as segments.
Drops the first n segments from the path, treating both leading and trailing slashes as segments.
Attributes
Drops the leading slash if available.
Drops the leading slash if available.
Attributes
Drops the last n segments from the path, treating both leading and trailing slashes as segments.
Drops the last n segments from the path, treating both leading and trailing slashes as segments.
Attributes
Drops the trailing slash if available.
Drops the trailing slash if available.
Attributes
Encodes the current path into a valid string.
Encodes the current path into a valid string.
Attributes
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Compares the receiver object (this
) with the argument object (that
) for equivalence.
Any implementation of this method should be an equivalence relation:
- It is reflexive: for any instance
x
of typeAny
,x.equals(x)
should returntrue
. - It is symmetric: for any instances
x
andy
of typeAny
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any instances
x
,y
, andz
of typeAny
ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
.
If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode
to ensure that objects which are "equal" (o1.equals(o2)
returns true
) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)
).
Value parameters
- that
-
the object to compare against this object for equality.
Attributes
- Returns
-
true
if the receiver object is equivalent to the argument;false
otherwise. - Definition Classes
-
Equals -> Any
Checks if the path contains a leading slash.
Checks if the path contains a leading slash.
Attributes
Checks if the path contains a trailing slash.
Checks if the path contains a trailing slash.
Attributes
Calculate a hash code value for the object.
Calculate a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)
) yet not be equal (o1.equals(o2)
returns false
). A degenerate implementation could always return 0
. However, it is required that if two objects are equal (o1.equals(o2)
returns true
) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)
). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals
method.
Attributes
- Returns
-
the hash code value for this object.
- Definition Classes
-
Any
Checks if the path is equal to "".
Checks if the path is equal to "".
Attributes
Checks if the path is equal to "/".
Checks if the path is equal to "/".
Attributes
Checks if the path is not equal to "".
Checks if the path is not equal to "".
Attributes
Normalizes the path for proper equals/hashCode treatment.
Normalizes the path for proper equals/hashCode treatment.
Attributes
RFC 3986 § 5.2.4 Remove Dot Segments
RFC 3986 § 5.2.4 Remove Dot Segments
Attributes
- Returns
-
the Path with
.
and..
resolved and removed
Creates a new path from this one with it's segments reversed.
Creates a new path from this one with it's segments reversed.
Attributes
Returns the "size" of a path, which counts leading and trailing slash, if present.
Returns the "size" of a path, which counts leading and trailing slash, if present.
Attributes
Checks if the path starts with the provided path
Checks if the path starts with the provided path
Attributes
Returns a new path containing the first n segments of the path, treating both leading and trailing slashes as segments.
Returns a new path containing the first n segments of the path, treating both leading and trailing slashes as segments.
Attributes
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
-
Any
Unnests a path that has been nested at the specified prefix. If the path is not nested at the specified prefix, the same path is returned.
Unnests a path that has been nested at the specified prefix. If the path is not nested at the specified prefix, the same path is returned.
Attributes
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product