Table of Contents

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

items IEnumerable<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

index int

The 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

JsonValueKind

Methods

Equals(JsonValue?)

Indicates whether the current object is equal to another object of the same type.

public override bool Equals(JsonValue? other)

Parameters

other JsonValue

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

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.