Skip to main content

[jax-rs-spec users] [jsr339-experts] Entity suffers from generic type problems

  • From: Bill Burke <bburke@...>
  • To: "jsr339-experts@..." <jsr339-experts@...>
  • Subject: [jax-rs-spec users] [jsr339-experts] Entity suffers from generic type problems
  • Date: Wed, 30 May 2012 16:37:54 -0400
  • List-id: <jsr339-experts.jax-rs-spec.java.net>

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

Attachment: Entity.java
Description: Text document



[jax-rs-spec users] [jsr339-experts] Entity suffers from generic type problems

Bill Burke 05/30/2012
 
 
Close
loading
Please Confirm
Close