Home PathSegment Class
PathSegment Class
Cancel

PathSegment Class

Namespace: Json.Path

Inheritance: PathSegment 🡒 object

Implemented interfaces:

  • IEquatable<PathSegment>

Represents a single path segment, generally indicated in the path by square brackets [].

Properties

NameTypeSummary
IsRecursiveboolIndicates whether the segment is evaluated as a recursive descent operation.
IsShorthandboolIndicates whether the segment is represented in its shorthand form (e.g. .foo instead of ['foo']).
SelectorsISelector[]Gets the collection of selectors present in the path.

Methods

BuildString(StringBuilder builder)

Builds a string representation using a System.Text.StringBuilder.

Declaration

1
public void BuildString(StringBuilder builder)
ParameterTypeDescription
builderStringBuilderA string builder.

Equals(PathSegment other)

Indicates whether the current Json.Path.PathSegment is equal to another Json.Path.PathSegment.

Declaration

1
public bool Equals(PathSegment other)
ParameterTypeDescription
otherPathSegmentA Json.Path.PathSegment to compare with this instance.

Returns

if the current instance is equal to; otherwise, .

Remarks

Shorthand syntax (Json.Path.PathSegment.IsShorthand) is ignored when comparing segments, so e.g. .foo and ['foo'] are considered equal.

Equals(object obj)

Determines whether the specified object is equal to the current object.

Declaration

1
public override bool Equals(object obj)
ParameterTypeDescription
objobjectThe object to compare with the current object.

Returns

if the specified object is equal to the current object; otherwise, .

GetHashCode()

Serves as the default hash function.

Declaration

1
public override int GetHashCode()

Returns

A hash code for the current object.

ToString()

Returns a string that represents the current object.

Declaration

1
public override string ToString()

Returns

A string that represents the current object.

Contents