jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] Re: Re: There could be more than one Link header for a given rel

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 23 Oct 2012 20:59:52 +0200

On Oct 23, 2012, at 7:35 PM, Markus KARG <markus_at_headcrashing.eu> wrote:

>> On Oct 22, 2012, at 12:53 PM, Markus KARG wrote:
>>
>>> As the RFC allows it, we have to support it. There is no need to add
>>> more methods if we *replace* getLink by getLinks.
>>
>> -1
>>
>> If we do that, we'd be designing the API for the exception not the
>> rule. In the majority of cases, you'd have a collection with a single
>> element.
>>
>> -- Santiago
>
> What if you must write a JAX-RS client for an existing service that actually
> is sending multiple same-name Links?
>
> What if you must re-write a service using JAX-RS that already had such an
> API and you must not break it for beakwards compatibility?
>
> We cannot say "sorry folks, Santiago thought nobody will need it, so do not
> use JAX-RS for it", as long as the RFC allows it.
>
> Also, I do not see any problem to simply write "getLinks()[0]" or
> "getLinks(0)" or "getLinks().next()" etc.
>

Please, correct me if I'm wrong, but based on this thread I thought the plan is to keep the convenience getLink(String rel) method to return the first value of getLinks(String rel) method, which we would also keep.

So your sarcasm seems unnecessary and based on not following the discussion carefully.

Marek

P.S. If in 99% of cases would people need to write getLinks(rel, 0) or getLinks(rel).next() instead of just getLink(rel), I do see a problem...