IntelligenceX

API Reference

Class

JsonValue

Namespace IntelligenceX.Json
Assembly IntelligenceX
Modifiers sealed

Represents a JSON value with a kind and raw value storage.

Inheritance

  • Object
  • JsonValue

Usage

Explore 37 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 20

Methods

public JsonArray? AsArray() #
Returns: JsonArray?

Reads this value as a JSON array, or null if not an array.

public Boolean AsBoolean(Boolean defaultValue = false) #
Returns: Boolean

Reads this value as a boolean, returning defaultValue if not a boolean.

Parameters

defaultValue System.Boolean = false optionalposition: 0
public Double? AsDouble() #
Returns: Double?

Reads this value as a double when possible.

public Int64? AsInt64() #
Returns: Int64?

Reads this value as a 64-bit integer when possible.

public JsonObject? AsObject() #
Returns: JsonObject?

Reads this value as a JSON object, or null if not an object.

public String? AsString() #
Returns: String?

Reads this value as a string, or null if not a string.

From 6 overloads
public static JsonValue From(Boolean value) #
Returns: JsonValue

Creates a boolean JSON value.

Parameters

value System.Boolean requiredposition: 0
public static JsonValue From(String? value) #
Returns: JsonValue

Creates a string JSON value (or null if the input is null).

Parameters

value System.String? requiredposition: 0
public static JsonValue From(Int64 value) #
Returns: JsonValue

Creates a numeric JSON value from a 64-bit integer.

Parameters

value System.Int64 requiredposition: 0
public static JsonValue From(Double value) #
Returns: JsonValue

Creates a numeric JSON value from a double.

Parameters

value System.Double requiredposition: 0
public static JsonValue From(JsonObject value) #
Returns: JsonValue

Wraps a JSON object value.

Parameters

value IntelligenceX.Json.JsonObject requiredposition: 0
public static JsonValue From(JsonArray value) #
Returns: JsonValue

Wraps a JSON array value.

Parameters

value IntelligenceX.Json.JsonArray requiredposition: 0
public override String ToString() #
Returns: String

Serializes the JSON value to a string.

Properties

public JsonValueKind Kind { get; } #

Gets the JSON kind of this value.

public Object? Value { get; } #

Gets the raw value payload.

Fields

public static readonly JsonValue Null #

Singleton null JSON value.