Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for Convert JSON array of arrays to map of objects (Java)

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Sep 15, 2020 at 15:06 comment added Michał Ziober @JosephGagnon, I'm glad it helped. Now I understand, you could say you want to have a list under a given key 😀
Sep 15, 2020 at 14:25 comment added Joseph Gagnon I was able to find a solution using your example. See my update in the original post.
Sep 15, 2020 at 14:06 comment added Michał Ziober @JosephGagnon, I do not understand what do you mean by child and parent items. In case of duplicated keys you need to use a list and save all duplicated objects. After that you can iterate over list and add to a Map using some other method to generate keys. You can create new question, link to this one, and describe what to you want to achieve. Also provide an example how it should work for better understanding.
Sep 15, 2020 at 12:24 vote accept Joseph Gagnon
Sep 15, 2020 at 11:55 comment added Joseph Gagnon This was helpful. You showed me some neat tricks I did not know about. There is a problem though. Because the PARENT ITEM NUMBER is not always unique (see my explanation in the posting), I'm running into an issue where it's trying to insert duplicate keys into dataMap. I think dataMap values need to be a list of "row" entries, representing the child items (idenitfied by 2ND ITEM NUMBER).
Sep 14, 2020 at 22:33 history answered Michał Ziober CC BY-SA 4.0

AltStyle によって変換されたページ (->オリジナル) /