Skip to content

JsonArray should have sort options #2

@anders88

Description

@anders88

It should be possible to sort a JsonArray in a simple way. One example would be to mimic the behavior of java.util.Collections.sort(List) and java.util.Collections.sort(List, Comparator).

Test cases should include: new JsonArray().add(4).add(2).add(3).sort() should return new JsonArray().add(2).add(3).add(4). Similarly for strings. new JsonArray().add(new JsonObject()).add(new JsonObject()).sort() should (probably) throw an exception. new JsonArray().add(new JsonObject()).add(new JsonObject()).sort((a, b) -> ...) should work.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions