尝试从 REST 服务获取实体。我的代码是这样的:
我想发送这样的对象:new GenericType<List<MyObject>>() {}
像这样的方法:
public static Object callRestWithUrl(String url, Class<?> responseObject)
throws MetaServiceException {
ClientResponse response = RESTConnectionUtils.callMetaService(url);
result = response.getEntity(responseObject);
.....
但它在运行时被评估为 List 而不是 GenericType 并引发异常。