--- Begin Message ---
Max (Weijun) Wang wrote:
1. How about setParameters(String name, List<String> values) so that I
can set a multivalued parameter in one call?
I think the most likely use case, is when you dynamically add the
parameters one at a time,
but that case is certainly possible. But I'd prefer to keep the API as
small as possible.
We already have six add/set variant. This one could be added in the
future though.
2. Why undefined result when input string is not a url-encoded query
string? Why not throw an Exception?
Yes, I'm still not happy with that point. It doesn't seem right.
3. public static UrlEncodedQueryString create(Map<String,List<String>>
pMap)
"Creates a UrlEncodedQueryString from the given Map. The order the
parameters are created in corresponds to the iteration order of the Map."
For a multivalued parameter, the order of these values should be
consistent to the List order and are put together, Right?
That makes sense, and probably should be specified as well.
4. Will the result of getParameterMap preserves the name order? If
not, does this mean that
UrlEncodedQueryString.create(q.getParameterMap()) may not equals to q?
Actually maps are equal, even if the iteration order is different. What
matters is the values of the mappings
themselves. So, thinking about 3 and 4 together, I think that the order
of the elements in a multi-valued parameter
probably does matter (and should be preserved) but the order of
(different named) parameters does not matter.
Thanks
michael.
--- End Message ---