반응형

* Gson JsonArray To List<String>

import java.lang.reflect.Type;
import com.google.gson.reflect.TypeToken;
// ...
Type listType = new TypeToken<List<String>>() {}.getType();
List<String> yourList = new Gson().fromJson(mapping.get("servers"), listType);

 

반응형
LIST

+ Recent posts