Skip to content

0.9.4

Compare
Choose a tag to compare
@ralfstx ralfstx released this 19 Jul 19:52
· 34 commits to master since this release
  • New API entrypoint: The new class Json can now be used to parse JSON and to create JSON values. This was done to prevent issues with inheritance (see #52). I hope it also makes the API easier to use and to remember.

    JsonValue value = Json.parse(string); // replaces JsonValue.readFrom(string)
    JsonValue name = Json.value("foo"); // replaces JsonValue.valueOf(...)
    JsonValue count = Json.value(23);

    The constants have also moved to Json:

    JsonValue checked = Json.TRUE; // replaces JsonValue.TRUE

    The old methods and constants are marked as deprecated, but remain available in 0.9.x.

  • New API to create JsonArrays from Java arrays and varargs:

    String[] strings = {"foo", "bar"};
    JsonArray names = Json.array(strings);
    JsonArray numbers = Json.array(23, 42);
  • New API to merge JSON objects:

    jsonObject.merge(otherObject);

    Thanks @phikal.

  • Fixed on Maven. The previous version was broken on Maven Central (#48). This is now fixed.

See the updated README for more details on the API changes.