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

Missing methods #1755

Closed
priand opened this issue Aug 18, 2020 · 3 comments
Closed

Missing methods #1755

priand opened this issue Aug 18, 2020 · 3 comments

Comments

@priand
Copy link

priand commented Aug 18, 2020

Would be great if you can add a few missing methods:
JsonObject/JsonArray: clear() -> empty the container, similar to Collection.clear()
JsonArray: addAt() -> insert an element at a defined index, similar to List addAt()

Would also help to have a JsonPrimitive get() that doesn't do any check, but just returns the raw value (Boolean, Number or String)

These are easy, non breaking add-ons that can simplify some code :-)

@sonu7089
Copy link

Can I contribute to resolving this issue!

@Marcono1234
Copy link
Collaborator

There are already some existing pull requests for JsonArray:

And there are also pull requests which want expose the internal List: #1209, #1619

@Marcono1234
Copy link
Collaborator

Marcono1234 commented Oct 16, 2022

#2225 has added the methods JsonArray.asList and JsonObject.asMap so it is at least now possible to use clear() and addAt (respectively add(int, JsonElement)) on the List and Map views from these methods.

@eamonnmcmanus eamonnmcmanus closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2023
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

4 participants