String jsonString = '[{"color":"white", "obfuscated":true, "text":"[G] "}, {"color":"black", "text":"Hello, user", "contents":[{"text":"show","bold":true}]}]'
arrayList = [
[
["color", "white"],
["obfuscated", true],
["text":"[G] "]
],
[
["color", "black"],
["text", "Hello, user"],
["contents", [{"text":"show","bold":true}]]
]
]
public class Test {
public static void main(String[] args) {
String jsonString = "[{\"color\":\"white\", \"obfuscated\":true, \"text\":\"[G] \"}, {\"color\":\"black\", \"text\":\"Hello, user\", \"contents\":[{\"text\":\"show\",\"bold\":true}]}]";
JSONArray array = new JSONArray(jsonString);
JSONObject object = array.getJSONObject(1);
JSONArray array1 = object.getJSONArray("contents");
JSONObject object1 = array1.getJSONObject(0);
System.out.println(object1.getString("text"));
System.out.println(object1.getBoolean("bold"));
}
}