json-string tmp => {"result_count":1、 "next_offset":1、 "entry_list":[{"id": "xyz123"、 "module_name": "Products"、 "name_value_list"を変換する必要があります: {"id":{"name": "id"、 "value": "xyz123"}、 "name":{"name": "name"、 "value": "test_product_2"}}}]、 "relationship_list ":[]} を対応するjava-pojoに
私のpojoは次のようになります
public class GetEntryListResponse {
public int result_count = 0;
public int next_offset = 0;
public List<EntryList> entryList = new ArrayList<EntryList>();
public static class EntryList {
String id = "";
String module_name = "";
public static class NameValueList {
public static class Id {
String name = "";
String value = "";
}
public static class Name {
String name = "";
String value = "";
}
}
}
}
脱穀作業には用途があります
Gson json_response = new Gson();
GetEntryListResponse resp = json_response.fromJson(tmp,
GetEntryListResponse.class);
他のバリエーションも試しましたが、これが今のところ最高のようです。問題は、result_countとnext_offsetがintに変換されますが、配列entryListの型がnull値であるということです。