mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.5 KiB
63 lines
1.5 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace Squidex.Infrastructure.Json.Objects
|
|
{
|
|
public sealed class JsonNull : IJsonValue, IEquatable<JsonNull>
|
|
{
|
|
public static readonly JsonNull Null = new JsonNull();
|
|
|
|
public JsonValueType Type
|
|
{
|
|
get { return JsonValueType.Null; }
|
|
}
|
|
|
|
private JsonNull()
|
|
{
|
|
}
|
|
|
|
public override bool Equals(object? obj)
|
|
{
|
|
return Equals(obj as JsonNull);
|
|
}
|
|
|
|
public bool Equals(IJsonValue? other)
|
|
{
|
|
return Equals(other as JsonNull);
|
|
}
|
|
|
|
public bool Equals(JsonNull? other)
|
|
{
|
|
return other != null;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
public string ToJsonString()
|
|
{
|
|
return ToString();
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return "null";
|
|
}
|
|
|
|
public bool TryGet(string pathSegment, [MaybeNullWhen(false)] out IJsonValue result)
|
|
{
|
|
result = null!;
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|