holopy3/Assets/UniGLTF/UniJSON/Scripts/JsonSchemaValidator/JsonBoolValidator.cs
Lena Biresch 490ef558ef CleanUp
2021-01-28 13:07:52 +01:00

45 lines
1,020 B
C#

using System;
namespace UniJSON
{
public class JsonBoolValidator : IJsonSchemaValidator
{
public override int GetHashCode()
{
return 1;
}
public override bool Equals(object obj)
{
var rhs = obj as JsonBoolValidator;
if (rhs == null) return false;
return true;
}
public void Assign(IJsonSchemaValidator obj)
{
throw new NotImplementedException();
}
public bool Parse(IFileSystemAccessor fs, string key, JsonNode value)
{
return false;
}
public JsonSchemaValidationException Validate(JsonSchemaValidationContext c, object o)
{
return null;
}
public void Serialize(JsonFormatter f, JsonSchemaValidationContext c, object o)
{
f.Value((bool)o);
}
public void ToJson(JsonFormatter f)
{
f.Key("type"); f.Value("boolean");
}
}
}