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

From: Bill Burke <>
Date: Wed, 30 May 2012 16:37:54 -0400

The 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