{"id":494,"date":"2020-08-19T01:15:40","date_gmt":"2020-08-19T01:15:40","guid":{"rendered":"http:\/\/emacslisp.com\/?p=494"},"modified":"2020-08-19T01:15:40","modified_gmt":"2020-08-19T01:15:40","slug":"spring-multivaluemap-and-linkedmultivaluemap","status":"publish","type":"post","link":"http:\/\/emacslisp.com\/?p=494","title":{"rendered":"Spring &#8211; MultiValueMap and LinkedMultiValueMap"},"content":{"rendered":"<p>MultiValueMap is common object type in Spring Utils source code.<\/p>\n<p>Here is an example of how to use it.<\/p>\n<pre lang=\"java\" line=\"1\">\r\nMultiValueMap<String, String> multiValueMaps = new LinkedMultiValueMap<String, String>();\r\nmultiValueMaps.add(\"Tom\", \"Book\");\r\nmultiValueMaps.add(\"Tom\", \"Pen\");\r\n\r\nmultiValueMaps.add(\"ABC\", \"Company\");\r\nmultiValueMaps.add(\"ABC\", \"WebSite\");\r\n\r\nfor(String key: multiValueMaps.keySet()) {\r\n\tList<String> value = multiValueMaps.get(key);\r\n\tSystem.out.print(key + \"\\t\");\r\n\tfor(String s: value) {\r\n\t\tSystem.out.print(s + \"\\t\");\r\n\t}\r\n\tSystem.out.println();\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MultiValueMap is common object type in Spring Utils source code. Here is an example of how to use it. MultiValueMap multiValueMaps = new LinkedMultiValueMap(); multiValueMaps.add(&#8220;Tom&#8221;, &#8220;Book&#8221;); multiValueMaps.add(&#8220;Tom&#8221;, &#8220;Pen&#8221;); multiValueMaps.add(&#8220;ABC&#8221;, &#8220;Company&#8221;); multiValueMaps.add(&#8220;ABC&#8221;, &#8220;WebSite&#8221;); for(String key: multiValueMaps.keySet()) { List value = multiValueMaps.get(key); System.out.print(key + &#8220;\\t&#8221;); for(String s: value) { System.out.print(s + &#8220;\\t&#8221;); } System.out.println(); }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,23],"tags":[],"class_list":["post-494","post","type-post","status-publish","format-standard","hentry","category-java","category-spring"],"_links":{"self":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=494"}],"version-history":[{"count":1,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/494\/revisions"}],"predecessor-version":[{"id":495,"href":"http:\/\/emacslisp.com\/index.php?rest_route=\/wp\/v2\/posts\/494\/revisions\/495"}],"wp:attachment":[{"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/emacslisp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}