MCPcopy Create free account
hub / github.com/apache/tomcat / toMap

Method toMap

java/org/apache/tomcat/util/http/MimeHeaders.java:143–155  ·  view source on GitHub ↗

Convert headers to a map. @return the map of headers

()

Source from the content-addressed store, hash-verified

141 * @return the map of headers
142 */
143 public Map<String,String> toMap() {
144 if (count == 0) {
145 return Collections.emptyMap();
146 }
147 Map<String,String> result = new HashMap<>();
148
149 for (int i = 0; i < count; i++) {
150 String name = headers[i].getName().toStringType();
151 String value = headers[i].getValue().toStringType();
152 result.merge(name, value, StringUtils::join);
153 }
154 return result;
155 }
156
157
158 /**

Callers 2

getNumActivePerKeyMethod · 0.45
listAllObjectsMethod · 0.45

Calls 4

toStringTypeMethod · 0.80
getNameMethod · 0.65
getValueMethod · 0.65
mergeMethod · 0.45

Tested by

no test coverage detected