IntelligenceX
Class

JsonValue

Namespace IntelligenceX.Json
Assembly IntelligenceX
Modifiers sealed

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

Inheritance

  • Object
  • JsonValue

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
public Nullable<Double> AsDouble() #
Returns: Nullable<Double>

Reads this value as a double when possible.

public Nullable<Int64> AsInt64() #
Returns: Nullable<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(JsonArray value) #
Returns: JsonValue

Creates a boolean JSON value.

Parameters

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

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

Parameters

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

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

Parameters

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

Creates a numeric JSON value from a double.

Parameters

value System.Double
From(IntelligenceX.Json.JsonObject value) #

Wraps a JSON object value.

Parameters

value IntelligenceX.Json.JsonObject
From(IntelligenceX.Json.JsonArray value) #

Wraps a JSON array value.

Parameters

value IntelligenceX.Json.JsonArray
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.