users@jsr311.java.net

Re: improvement of UriBuider.{query,matrix}Parameters and MultivaluedMap

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 19 Jun 2008 10:26:16 +0200

On Jun 19, 2008, at 9:55 AM, Stephan Koops wrote:

> Hi,
>>>> For the MultivaluedMap it seems useful to me to add:
>>>> • public <A> A getFirst(K key, Class<A> convertTo)
>>>> • public <A> A getFirst(K key, Class<A> convertTo, A
>>>> defaultValue)
>>>> • public <A> A getFirst(K key, A defaultValue); // if the
>>>> defaultValue is directly the class to convert to (e.g. no
>>>> subclass) it would work without the class parameter, I think.
>>>> • public <A> List<A> get(K key, Class<A> convertTo)
>>> We had this kind of generic method in our initial sketch of the
>>> API but we removed them - I can't recall why now - Paul ?
>> I don't fully recall. Such methods are still in the Jersey
>> implementation. Perhaps we removed them from the iface for two
>> reasons:
>>
>> - it added some complexity and we wanted to keep things simple.
> IMO the main place for simplicity is the use by application
> developers and not the implementation of the API.
>

I was not referring to the implementation. MultivaluedMap is a very
simple interface. If we add more methods it becomes more complex.
Those methods should add sufficient value, and i am wondering whether
they actually do given the use of @*Param.

Paul.