Skip to content

PathSegment

@LowLevelApi
sealed class PathSegment

Single segment in a Path.

Each subclass represents a different type of segment that can appear in a path, and links to the high-level factory to obtain an instance of this path.

The high-level operators are only available in correct contexts to disambiguate multiple usages of the same operator. Subclasses of this type do not protect against these usages.

Inheritors

Types

AllPositional

Path segment for the "all positional" operator (.$[].).

Field

@LowLevelApi
data class Field(val name: String) : PathSegment

Path segment representing the name of a field.

FilteredPositional

@LowLevelApi
data class FilteredPositional(val filterName: String) : PathSegment

Path segment for the "filtered positional" operator (.$[<filterName>]).

Indexed

@LowLevelApi
data class Indexed(val index: Int) : PathSegment

Path segment representing an indexed element in an array.

Positional

Path segment for the "positional" operator (.$.).

Functions

toString

abstract override fun toString(): String

Returns the string representation of this PathSegment. To obtain the representation of an entire Path, see Path.toString.