0

I want to move the java JSON element(JSON array) into Java set. How do I do that in a simpler manner?

JsonElement newdcdc = npsdfs.seget();

sample JSON element

[
  {
    "expand": "desc",
    "key":"qwe1"
  },
  {
    "expand": "descrip",
    "key":"qwe2"
  },
  {
    "expand": "description",
    "key":"qwe3"
  }
]

i need to create some set with all keys so how i do that

8
  • 2
    Possible duplicate of Converting JSON Data to a set of Java objects Commented Mar 8, 2019 at 14:29
  • i need to create java set Commented Mar 8, 2019 at 14:30
  • there we can see so many json object in json array Commented Mar 8, 2019 at 14:32
  • You have to make them POJO first, and then add Them into a Set. Commented Mar 8, 2019 at 14:34
  • do you have any example for that Commented Mar 8, 2019 at 14:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.