Java
0
Вклад в тег
public class Answer<T> {
private Info info;
private T[] results;
}
public <T> Answer<T> requestAll(String endpoint, Class<T> tClass){
String jsonObject = restClient.get()
.uri(endpoint)
.retrieve()
.body(String.class);
Type type = TypeToken.getParameterized(Answer.class, tClass).getType();
return new Gson().fromJson(jsonObject, type);
}