Home JsonPointerSegment Struct
JsonPointerSegment Struct
Cancel

JsonPointerSegment Struct

Namespace: Json.Pointer

Inheritance: JsonPointerSegment 🡒 ValueType 🡒 object

Represents a segment of a JSON Pointer. This is a ref struct to ensure zero allocations.

Methods

AsSpan()

Gets the raw span representation of this segment.

Declaration

1
public ReadOnlySpan<char> AsSpan()

Returns

The segment as a ReadOnlySpan<char>.

Equals(string value)

Compares this segment with a string, handling both encoded and unencoded values.

Declaration

1
public bool Equals(string value)
ParameterTypeDescription
valuestringThe value to compare against (can be encoded or unencoded)

Returns

True if the segment matches the value, false otherwise

Equals(int value)

Compares this segment with an integer.

Declaration

1
public bool Equals(int value)
ParameterTypeDescription
valueintThe value to compare against

Returns

True if the segment matches the value, false otherwise

Equals(JsonPointerSegment other)

Compares this segment with another segment.

Declaration

1
public bool Equals(JsonPointerSegment other)
ParameterTypeDescription
otherJsonPointerSegmentThe segment to compare against.

Returns

True if the segments are equal; false otherwise.

Equals(object obj)

Indicates whether this instance and a specified object are equal.

Declaration

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

Returns

true ifobj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

(deprecated) Returns the hash code for this instance.

Declaration

1
public override int GetHashCode()

Returns

A 32-bit signed integer that is the hash code for this instance.

ToInt()

Returns the int representation of this segment.

Declaration

1
public int? ToInt()

Returns

The segment as an int, or null if the segment is not a valid integer.

ToString()

Returns the string representation of this segment.

Declaration

1
public override string ToString()

Returns

The segment as a string.

Contents