>True. Dictionary#get() can only return a single type, so 
>ResponsePropertiesDictionary has to implement Dictionary<String, 
>ImmutableList<String>>. However, put() can support overloads. We could 
>potentially add put(String, Sequence<String>) methods to ArgumentsDictionary 
>and RequestPropertiesDictionary to support this feature.

Wait - that doesn't completely work because it would preclude a caller from 
retrieving any sequence values that were set. How about this: instead of 
changing the type of the Dictionary parameters, what if we did something like 
this that all of the dictionaries could implement:

    public interface QueryDictionary 
        extends Dictionary<String, String>, Iterable<String> {        
        public String get(String key, int index);
        public String put(String key, Sequence<String> values);
    }

I think this might support the multi-value use case. As a nice side effect, it 
wouldn't break any existing code.  :-)

Thoughts?



Reply via email to