Class JsonArray
- Namespace
- Nerdbank.Json
- Assembly
- Nerdbank.Json.dll
An immutable JSON array.
public sealed class JsonArray : JsonValue, IEquatable<JsonValue>, IReadOnlyList<JsonValue>, IReadOnlyCollection<JsonValue>, IEnumerable<JsonValue>, IEnumerable
- Inheritance
-
JsonArray
- Implements
- Inherited Members
Constructors
JsonArray(IEnumerable<JsonValue>)
Initializes a new instance of the JsonArray class.
public JsonArray(IEnumerable<JsonValue> items)
Parameters
itemsIEnumerable<JsonValue>The elements. The sequence is copied.
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
this[int]
Gets the element at the specified index in the read-only list.
public JsonValue this[int index] { get; }
Parameters
indexintThe zero-based index of the element to get.
Property Value
- JsonValue
The element at the specified index in the read-only list.
Kind
Gets the kind of this value.
public override JsonValueKind Kind { get; }
Property Value
Methods
Equals(JsonValue?)
Indicates whether the current object is equal to another object of the same type.
public override bool Equals(JsonValue? other)
Parameters
otherJsonValueAn object to compare with this object.
Returns
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<JsonValue> GetEnumerator()
Returns
- IEnumerator<JsonValue>
An enumerator that can be used to iterate through the collection.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.