1

How do I come up with a generalised structure for this type of JSON file? I have tried to encapsulate it into a ArrayList<ArrayList<String>> but that doesn't quite work because "Structure1", "Structure 2" etc is lost. There could be more than 3 structures. I would also highly appreciate it if someone could point me in the right direction to how I could read and write this structure from a file using Gson.

{
            "Structure1": [
              [
                    "StringValue1",
                    "StringValue2"
              ],
              [
                    "StringValue1",
                    "StringValue2"
              ]
            ],
            "Structure2": [
              [
                    "StringValue1",
                    "StringValue2"
              ]
            ],
            "Structure3": [
              [
                    "StringValue1",
                    "StringValue2"
              ]
            ]
        }
noobcoder
  • 6,089
  • 2
  • 18
  • 34

0 Answers0