Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonArray should have sort options #2

Open
anders88 opened this issue Apr 20, 2016 · 0 comments
Open

JsonArray should have sort options #2

anders88 opened this issue Apr 20, 2016 · 0 comments

Comments

@anders88
Copy link
Owner

anders88 commented Apr 20, 2016

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.

Repository owner deleted a comment from anders88 Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants