JsonPathFunctionArgument<TValue> Struct

A typed function argument or result retaining native navigator values without JSON conversion.

public readonly struct JsonPathFunctionArgument<TValue>

Type parameters

TValue
The navigator's node type.

Properties

NameDescription
IsNodeGets whether this value is a native navigator node rather than a literal.
IsNothingGets whether this value is Nothing, rather than JSON null.
LogicalGets the logical result. Throws for other argument types.
NodeGets the native node. Throws when this is not a native value.
NodesGets the ordered node list. Throws for other argument types.
NothingCreates Nothing, distinct from JSON null.
NullCreates JSON null. A default argument also represents JSON null.
TypeGets the RFC function type.

Gets whether this value is a native navigator node rather than a literal.

public bool IsNode { get; }

Property value

bool

Gets whether this value is Nothing, rather than JSON null.

public bool IsNothing { get; }

Property value

bool

Gets the logical result. Throws for other argument types.

public bool Logical { get; }

Property value

bool

Gets the native node. Throws when this is not a native value.

public TValue? Node { get; }

Property value

TValue?

Gets the ordered node list. Throws for other argument types.

public IReadOnlyList<TValue?> Nodes { get; }

Creates Nothing, distinct from JSON null.

public static JsonPathFunctionArgument<TValue> Nothing { get; }

Creates JSON null. A default argument also represents JSON null.

public static JsonPathFunctionArgument<TValue> Null { get; }

Gets the RFC function type.

public JsonPathFunctionType Type { get; }

Property value

JsonPathFunctionType

Methods

NameDescription
FromBoolean(bool)Creates a JSON boolean value (not LogicalType).
FromLogical(bool)Creates a logical result (not a JSON boolean).
FromNode(TValue?)Creates a value from a native node, including a native JSON null.
FromNodes(IEnumerable<TValue?>)Creates a node list by copying its membership and preserving order and duplicates.
FromNumber(double)Creates a number using the evaluator's double-precision representation.
FromString(string)Creates a string value.
GetValueKind(JsonPathNavigator<TValue>)Gets the JSON kind of a value, or null for Nothing. Throws for other argument types.
TryGetBoolean(JsonPathNavigator<TValue>, bool)Reads a boolean from a literal or native value.
TryGetNumber(JsonPathNavigator<TValue>, double)Reads a number from a literal or native value.
TryGetString(JsonPathNavigator<TValue>, string?)Reads a string from a literal or native value.

Creates a JSON boolean value (not LogicalType).

public static JsonPathFunctionArgument<TValue> FromBoolean(bool value)

Creates a logical result (not a JSON boolean).

public static JsonPathFunctionArgument<TValue> FromLogical(bool value)

Creates a value from a native node, including a native JSON null.

public static JsonPathFunctionArgument<TValue> FromNode(TValue? node)

Parameters

node TValue?

Returns

JsonPathFunctionArgument<TValue>

FromNodes(IEnumerable<TValue?>)

JsonPathFunctionArgument`1.cs

Creates a node list by copying its membership and preserving order and duplicates.

public static JsonPathFunctionArgument<TValue> FromNodes(IEnumerable<TValue?> nodes)

Creates a number using the evaluator's double-precision representation.

public static JsonPathFunctionArgument<TValue> FromNumber(double value)

Creates a string value.

public static JsonPathFunctionArgument<TValue> FromString(string value)

GetValueKind(JsonPathNavigator<TValue>)

JsonPathFunctionArgument`1.cs

Gets the JSON kind of a value, or null for Nothing. Throws for other argument types.

public JsonPathNodeKind? GetValueKind(JsonPathNavigator<TValue> navigator)

TryGetBoolean(JsonPathNavigator<TValue>, bool)

JsonPathFunctionArgument`1.cs

Reads a boolean from a literal or native value.

public bool TryGetBoolean(JsonPathNavigator<TValue> navigator, out bool value)

Parameters

navigator JsonPathNavigator<TValue>
value bool

Returns

bool

TryGetNumber(JsonPathNavigator<TValue>, double)

JsonPathFunctionArgument`1.cs

Reads a number from a literal or native value.

public bool TryGetNumber(JsonPathNavigator<TValue> navigator, out double value)

Parameters

navigator JsonPathNavigator<TValue>
value double

Returns

bool

TryGetString(JsonPathNavigator<TValue>, string?)

JsonPathFunctionArgument`1.cs

Reads a string from a literal or native value.

public bool TryGetString(JsonPathNavigator<TValue> navigator, out string? value)

Parameters

navigator JsonPathNavigator<TValue>
value string?

Returns

bool