users@jax-rs-spec.java.net

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

From: Bill Burke <bburke_at_redhat.com>
Date: Fri, 15 Jun 2012 08:59:32 -0400

I did, but scratch it. I had forgotten about GenericEntity.

On 6/15/12 6:36 AM, Marek Potociar wrote:
> Hi Bill,
>
> Can you please file a JIRA issue (if not done yet)? I've just returned from hospital and I'm in the middle of something else at the same time, so I'd like to find some more quiet time and get back to it later and make sure it's not forgotten buried under new emails.
>
> Thanks,
> Marek
>
> On May 30, 2012, at 10:37 PM, Bill Burke wrote:
>
>> 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
>> <Entity.java>
>

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com