I have a JSON array which contains objects such as this:
{
\"bjones\": {
\"fname\": \"Betty\",
\"lname\": \"Jones\",
\"password\": \
Use entrySet to get the keys. Loop through the entries and create a User for every key.
JsonObject result = p.parse(file).getAsJsonObject();
Set> entrySet = result.entrySet();
for(Map.Entry entry : entrySet) {
User newUser = gson.fromJson(p.getAsJsonObject(entry.getKey()), User.class);
newUser.username = entry.getKey();
//code...
}