I have got GSON as a JSON parser in Java, but the keys aren\'t always the same. For example. I have the following JSON:
{ \"The Object I already
As of Gson 2.8.1 you can use keySet():
keySet()
String json = "{\"key1\":\"val\", \"key2\":\"val\"}"; JsonParser parser = new JsonParser(); JsonObject jsonObject = parser.parse(json).getAsJsonObject(); Set keys = jsonObject.keySet();