Releases: Moderocky/Argo
Releases · Moderocky/Argo
String Escaping
This release handles escaping and un-escaping strings.
Full Changelog: 1.1.1...1.1.4
Direct Array Creation
This release allows arrays to be converted directly, rather than via objects.
It also supports converting single-type json arrays.
final int[] result = Json.fromJson("[1, 2, 3]", new int[0]);
If arrays have a specified size they will trim any additional data.
final int[] result = Json.fromJson("[1, 8, 3, 6, 7]", new int[2]);
assert result.length == 2;
This also works with objects of complex type, which will be converted.
final MyClass[] result = Json.fromJson("[ {...}, {...} ]", new MyClass[0]);
Full Changelog: 1.1.0...1.1.1
Object Conversion
This release contains an object <-> json conversion system.
This is designed for accessing the json data more easily, rather than for serialisation.
final String data = // { "a": 1, "b": 6, "hello": "there" }
class Result { int a, b; String hello; }
final Result result = Json.fromJson(data, new Result());
assert result.a == 1;
assert result.b == 6;
assert result.hello.equals("there");
result.a++;
final String string = Json.toJson(result);
// string = { "a": 2, "b": 6, "hello": "there" }
Full Changelog: 1.0.0...1.1.0
Initial Release
Full Changelog: https://github.com/Moderocky/Argo/commits/1.0.0