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)
| Parameter | Type | Description |
|---|---|---|
| value | string | The 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)
| Parameter | Type | Description |
|---|---|---|
| value | int | The 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)
| Parameter | Type | Description |
|---|---|---|
| other | JsonPointerSegment | The 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)
| Parameter | Type | Description |
|---|---|---|
| obj | object | The object to compare with the current instance. |
Returns
true if
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.