From: John U. <uj...@gm...> - 2017-01-16 17:53:52
|
Ok, thanks, so I can use response.readEntity(MyPojo.class), that works. My main problem here is that the old pattern of using ClientResponse<MyPojo> with a generic type parameter is not only deprecated but no longer works at all. In the code I'm currently working on, I must check the HTTP response status with all calls to the client, so now I have to use the interface pattern where the method returns a (non-generic) Response type, not a POJO. This, however changes my previous call patterns from something like MyPojo myPojo = entitySuccessful0(client.myMethod0(…)); with <T> T entitySuccessful0(ClientResponse<T> response) { if (!Family.SUCCESSFUL.equals(response.getResponseStatus().getFamily())) { throw …; } return response.getEntity(); } to something like MyPojo myPojo = entitySuccessful2(client.myMethod2(…), MyPojo.class)); with <T> T entitySuccessful2(Response response, Class<T> type) { if (!Family.SUCCESSFUL.equals(response.getStatusInfo().getFamily())) { throw …; } return response.readEntity(type); } This is a breaking change to MANY (ie, many 1.000s of) lines of code for all applications that use the client. Cheers John |