The javax.ws.rs.client.Entity class suffers from the same generic type
problems that exist for ResponseBuilder and the reason GenericEntity exists.
See attached file:
proposed changes:
* @Deprecate GenericEntity. I'd rather do this because Entity is a
shorter name.
* Change ClientRequestContext.setEntity to accept an Entity class
parameter only
* Same static methods as before
* Entity now has a getAnnotations() method
* Entity now has a Type getType() method
* some new constructors that allow you set various things
new Entity<List<String>>(obj, MediaType.XML){};
new Entity<List<String>>(obj, myVariant, myAnnotations){};
new Entity(obj, genericType, myVariant, myAnnotations);
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com