Add addAll(MultiValueMap)

This commit introduces a new method for MultiValueMap: addAll, which
adds all values of a given map (cf putAll, which replaces existing
values).
This commit is contained in:
Arjen Poutsma
2017-06-12 14:12:12 +02:00
parent 7085a30382
commit 9bf82dc18f
5 changed files with 35 additions and 0 deletions

View File

@@ -1357,6 +1357,13 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
currentValues.addAll(values);
}
@Override
public void addAll(MultiValueMap<String, String> values) {
for (Entry<String, List<String>> entry : values.entrySet()) {
addAll(entry.getKey(), entry.getValue());
}
}
/**
* Set the given, single header value under the given name.
* @param headerName the header name