Implement ToNative() on JSONSpecial

master
Harald Wolff 2019-10-04 20:10:00 +02:00
parent 1a24ea939e
commit 20f9fcd4f5
1 changed files with 6 additions and 3 deletions

View File

@ -6,18 +6,21 @@ namespace ln.json
public static JSONTrue Instance { get; } = new JSONTrue(); public static JSONTrue Instance { get; } = new JSONTrue();
private JSONTrue() : base(JSONValueType.TRUE) { } private JSONTrue() : base(JSONValueType.TRUE) { }
public override string ToString() => "true"; public override string ToString() => "true";
} public override object ToNative() => true;
}
public class JSONFalse : JSONValue public class JSONFalse : JSONValue
{ {
public static JSONFalse Instance { get; } = new JSONFalse(); public static JSONFalse Instance { get; } = new JSONFalse();
private JSONFalse() : base(JSONValueType.FALSE) { } private JSONFalse() : base(JSONValueType.FALSE) { }
public override string ToString() => "false"; public override string ToString() => "false";
} public override object ToNative() => false;
}
public class JSONNull : JSONValue public class JSONNull : JSONValue
{ {
public static JSONNull Instance { get; } = new JSONNull(); public static JSONNull Instance { get; } = new JSONNull();
private JSONNull() : base(JSONValueType.NULL) { } private JSONNull() : base(JSONValueType.NULL) { }
public override string ToString() => "null"; public override string ToString() => "null";
} public override object ToNative() => null;
}
} }