32 references to JsonValueType
Microsoft.Analyzers.Local (31)
ApiLifecycle\Json\JsonValue.cs (31)
26
public static readonly JsonValue Null = new(
JsonValueType
.Null, default, null);
42
Type =
JsonValueType
.Boolean;
59
Type =
JsonValueType
.Number;
76
Type =
JsonValueType
.String;
93
Type =
JsonValueType
.Object;
110
Type =
JsonValueType
.Array;
127
private JsonValue(
JsonValueType
type, double value, object? reference)
138
public
JsonValueType
Type { get; }
144
public bool IsNull => Type ==
JsonValueType
.Null;
150
public bool IsBoolean => Type ==
JsonValueType
.Boolean;
164
public bool IsNumber => Type ==
JsonValueType
.Number;
170
public bool IsString => Type ==
JsonValueType
.String;
176
public bool IsJsonObject => Type ==
JsonValueType
.Object;
182
public bool IsJsonArray => Type ==
JsonValueType
.Array;
196
JsonValueType
.Boolean => _value == 1,
197
JsonValueType
.Number => _value != 0,
198
JsonValueType
.String => !string.IsNullOrEmpty((string?)_reference),
199
JsonValueType
.Object or
JsonValueType
.Array => true,
233
JsonValueType
.Boolean => _value == 1 ? 1 : 0,
234
JsonValueType
.Number => _value,
235
JsonValueType
.String => double.TryParse((string?)_reference, NumberStyles.Float, CultureInfo.InvariantCulture, out var number)
247
JsonValueType
.Boolean => (_value == 1)
250
JsonValueType
.Number => _value.ToString(CultureInfo.InvariantCulture),
251
JsonValueType
.String => (string?)_reference,
283
JsonValueType
.Boolean or
JsonValueType
.Number => _value,
284
JsonValueType
.String or
JsonValueType
.Object or
JsonValueType
.Array => _reference,
616
public
JsonValueType
Type => _jsonValue.Type;
Microsoft.Analyzers.Local.Tests (1)
Json\JsonScannerTest.cs (1)
53
Assert.Equal(
JsonValueType
.Object, obj.Type);