4
public class Response<T> {
private String field;
private ResponseEntity<T>;
}
public ResponseEntity<T> {
private String entity;
private List<T> items;
}
public abstract class AbstractSearchImpl<T> {
// 省略大部分代码
public BaseSearchResponse search(Request request) {
return JSONObject.parseObject(searchResult.getResult(), new TypeReference<BaseSearchResponse<T>>() {
});
}
}
public class SearchDemo extends AbstractSearchImpl<DemoResult> {
}
以上,但是最后ResponseEntity#items中的实际类型,还是jsonObject,请问该如何解决啊