{"id":4008,"date":"2012-12-03T10:00:13","date_gmt":"2012-12-03T08:00:13","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=4008"},"modified":"2014-11-08T14:15:52","modified_gmt":"2014-11-08T12:15:52","slug":"google-guava-multimaps","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html","title":{"rendered":"Google Guava MultiMaps"},"content":{"rendered":"<h2>Guava?<\/h2>\n<p>This is the first in a series of posts where I&#8217;ll be attempting to explain and explore Google&#8217;s awesome<a href=\"http:\/\/code.google.com\/p\/guava-libraries\/\"> Guava java library<\/a>.<\/p>\n<p>I first came across Guava whilst searching for generic versions of Apache Commons Collections &#8211; I needed a <code>Bimap<\/code> and was fed up with having to pepper my code with casts &#8211; however what I found was much much better.<\/p>\n<p>Not only does it contain various implementations of more complex (but useful) collection types-<a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release09\/javadoc\/com\/google\/common\/collect\/Multimap.html\">Multimaps<\/a>,<a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release09\/javadoc\/com\/google\/common\/collect\/Multiset.html\">Multisets<\/a>,<a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release09\/javadoc\/com\/google\/common\/collect\/BiMap.html\">Bimaps<\/a>&#8211; which I&#8217;ll discuss in detail, but also facilities to support a more functional style of programming with immutable collections, and<a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release09\/javadoc\/com\/google\/common\/base\/Function.html\">function<\/a> and<a href=\"http:\/\/docs.guava libraries.googlecode.com\/git-history\/release09\/javadoc\/com\/google\/common\/base\/Predicate.html\">predicate<\/a> objects. This has both completely changed the way I write java, and at the same time made me increasingly frustrated with Java&#8217;s sometimes clunky syntax, something I intend to explore in further posts.<\/p>\n<p>Anyway enough with the introduction, and on with the good stuff. The first thing I&#8217;d like to take a look at is the Multimap, which is probably the single Guava feature I&#8217;ve made the most use of.<\/p>\n<h3>Mutlimaps<\/h3>\n<p>So, how often have you needed a data structure like the following?<\/p>\n<pre class=\"brush:java\">Map&lt;String,List&lt;MyClass&gt;&gt; myClassListMap test2\r\n                              = new HashMap&lt;String,List&lt;MyClass&gt;&gt;()<\/pre>\n<p>If you&#8217;re anything like me, fairly frequently. And don&#8217;t you find yourself writing the same boilerplate code over and over again?<\/p>\n<p>To put a key\/value pair into this map, you need to first check if a list already exists for your key, and if it doesn&#8217;t create it. You&#8217;ll end up writing something along the lines of the following:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:java\">void putMyObject(String key, Object value) {\r\n    List&lt;Object&gt; myClassList = myClassListMap.get(key);\r\n    if(myClassList == null) {\r\n        myClassList = new ArrayList&lt;object&gt;();\r\n        myClassListMap.put(key,myClassList);\r\n    }\r\n    myClassList.add(value);\r\n}<\/pre>\n<p>Bit of a pain, and what if you need methods to check a value exists, or remove a value, or even iterate over the entire data structure. That can be quite a lot of code.<\/p>\n<h3>Never fear Guava is here!<\/h3>\n<p>Just like the standard java collections, Guava defines several interfaces and matching implementations. Usually you want to code to an interface, and only worry about the implementation when you create it. In this case we&#8217;re interested in Multimaps.<\/p>\n<p>So using a multimap, we could replace the data structure declaration with the following:<\/p>\n<pre class=\" brush:java\">Multimap&lt;String,Object&gt; myMultimap = ArrayListMultimap.create();<\/pre>\n<p>There&#8217;s a few things to note here. The generic type declaration should look very familiar, this is exactly how you would declare a normal Map.<\/p>\n<p>You may have been expecting to see<code> new ArrayListMultimap&lt;String,Object&gt;()<\/code> on the right-hand side of the equals. Well, all Guava collection implementations offer a<code> create<\/code> method, which is usually more concise and has the advantage that you do not have to duplicate the generic type information.<\/p>\n<p>Guava in fact adds similar functionality to the standard Java collections. For example, if you examine<a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release09\/javadoc\/com\/google\/common\/collect\/Lists.html\"><code> com.google.common.collect.Lists<\/code><\/a>, you&#8217;ll see static<code> newArrayList()<\/code>, and<code> newLinkedList()<\/code> methods, so you can take advantage of this conciseness even with the standard Java collections. (I&#8217;ll aim to cover this in more detail in a future post).<\/p>\n<p>So we&#8217;ve declared and instantiated a multimap, how do we go about using them? Easy just like a normal map!<\/p>\n<pre class=\"brush:java\">public class MutliMapTest {\r\n    public static void main(String... args) {\r\n  Multimap&lt;String, String&gt; myMultimap = ArrayListMultimap.create();\r\n\r\n  \/\/ Adding some key\/value\r\n  myMultimap.put('Fruits', 'Bannana');\r\n  myMultimap.put('Fruits', 'Apple');\r\n  myMultimap.put('Fruits', 'Pear');\r\n  myMultimap.put('Vegetables', 'Carrot');\r\n\r\n  \/\/ Getting the size\r\n  int size = myMultimap.size();\r\n  System.out.println(size);  \/\/ 4\r\n\r\n  \/\/ Getting values\r\n  Collection&lt;string&gt; fruits = myMultimap.get('Fruits');\r\n  System.out.println(fruits); \/\/ [Bannana, Apple, Pear]\r\n\r\n  Collection&lt;string&gt; vegetables = myMultimap.get('Vegetables');\r\n  System.out.println(vegetables); \/\/ [Carrot]\r\n\r\n  \/\/ Iterating over entire Mutlimap\r\n  for(String value : myMultimap.values()) {\r\n   System.out.println(value);\r\n  }\r\n\r\n  \/\/ Removing a single value\r\n  myMultimap.remove('Fruits','Pear');\r\n  System.out.println(myMultimap.get('Fruits')); \/\/ [Bannana, Pear]\r\n\r\n  \/\/ Remove all values for a key\r\n  myMultimap.removeAll('Fruits');\r\n  System.out.println(myMultimap.get('Fruits')); \/\/ [] (Empty Collection!)\r\n }\r\n}<\/pre>\n<p>One thing you may be wondering, is why does the get method return a <code>Collection<\/code> and not a <code>List<\/code>, that would be much more useful. Indeed it would. The problem is there are several different implementations available, some use Lists-<code>ArrayListMultimap<\/code>, <code>LinkedListMultimap<\/code> etc. &#8211; and some use Sets &#8211; <code>HashMultimap<\/code>,<code>TreeMultimap<\/code> among others.<\/p>\n<p>To handle this &#8211; if you need to work directly with the Lists, or Sets in the map &#8211; there are several subinterfaces defined. <code>ListMultimap<\/code>, <code>SetMultimap<\/code>, and <code>SortedSetMultimap<\/code>. These all do what you&#8217;d expect, and their methods that return collections, will return one of the approprite type.<\/p>\n<p>ie<\/p>\n<pre class=\"brush:java\">ListMutlimap&lt;String,String&gt; myMutlimap = ArrayListMultimap.create();\r\n\r\nList&lt;string&gt; myValues = myMutlimap.get('myKey');  \/\/ Returns a List, not a Collection.<\/pre>\n<p>That&#8217;s basically all there is to them. I recommend looking at the API:<a href=\"http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release09\/javadoc\/com\/google\/common\/collect\/Multimap.html\">http:\/\/docs.guava-libraries.googlecode.com\/git-history\/release09\/javadoc\/com\/google\/common\/collect\/Multimap.html<\/a>, where you can find the various implementations, you should be able to find one that suits your needs.<\/p>\n<p><strong><em><br \/>\nReference: <\/em><\/strong><a href=\"http:\/\/tomjefferys.blogspot.com\/2011\/09\/multimaps-google-guava.html\">Multimaps &#8211; Google Guava<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Tom Jefferys at the <a href=\"http:\/\/tomjefferys.blogspot.com\/\">Tom&#8217;s Programming Blog <\/a> blog.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Guava? This is the first in a series of posts where I&#8217;ll be attempting to explain and explore Google&#8217;s awesome Guava java library. I first came across Guava whilst searching for generic versions of Apache Commons Collections &#8211; I needed a Bimap and was fed up with having to pepper my code with casts &#8211; &hellip;<\/p>\n","protected":false},"author":155,"featured_media":148,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[280],"class_list":["post-4008","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-google-guava"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Google Guava MultiMaps<\/title>\n<meta name=\"description\" content=\"Guava? This is the first in a series of posts where I&#039;ll be attempting to explain and explore Google&#039;s awesome Guava java library. I first came across\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Guava MultiMaps\" \/>\n<meta property=\"og:description\" content=\"Guava? This is the first in a series of posts where I&#039;ll be attempting to explain and explore Google&#039;s awesome Guava java library. I first came across\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-12-03T08:00:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-08T12:15:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Tom Jefferys\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom Jefferys\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html\"},\"author\":{\"name\":\"Tom Jefferys\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/673556f9698e4cc973c6b2a033d526d9\"},\"headline\":\"Google Guava MultiMaps\",\"datePublished\":\"2012-12-03T08:00:13+00:00\",\"dateModified\":\"2014-11-08T12:15:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html\"},\"wordCount\":643,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"keywords\":[\"Google Guava\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html\",\"name\":\"Google Guava MultiMaps\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"datePublished\":\"2012-12-03T08:00:13+00:00\",\"dateModified\":\"2014-11-08T12:15:52+00:00\",\"description\":\"Guava? This is the first in a series of posts where I'll be attempting to explain and explore Google's awesome Guava java library. I first came across\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/java-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/12\\\/google-guava-multimaps.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Google Guava MultiMaps\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/673556f9698e4cc973c6b2a033d526d9\",\"name\":\"Tom Jefferys\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c18533c5fb898db45609a696474327815eb2fc647e934d3a87d87f0a7002173?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c18533c5fb898db45609a696474327815eb2fc647e934d3a87d87f0a7002173?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c18533c5fb898db45609a696474327815eb2fc647e934d3a87d87f0a7002173?s=96&d=mm&r=g\",\"caption\":\"Tom Jefferys\"},\"sameAs\":[\"http:\\\/\\\/tomjefferys.blogspot.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Tom-Jefferys\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Guava MultiMaps","description":"Guava? This is the first in a series of posts where I'll be attempting to explain and explore Google's awesome Guava java library. I first came across","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html","og_locale":"en_US","og_type":"article","og_title":"Google Guava MultiMaps","og_description":"Guava? This is the first in a series of posts where I'll be attempting to explain and explore Google's awesome Guava java library. I first came across","og_url":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-12-03T08:00:13+00:00","article_modified_time":"2014-11-08T12:15:52+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","type":"image\/jpeg"}],"author":"Tom Jefferys","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Tom Jefferys","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html"},"author":{"name":"Tom Jefferys","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/673556f9698e4cc973c6b2a033d526d9"},"headline":"Google Guava MultiMaps","datePublished":"2012-12-03T08:00:13+00:00","dateModified":"2014-11-08T12:15:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html"},"wordCount":643,"commentCount":2,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","keywords":["Google Guava"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html","url":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html","name":"Google Guava MultiMaps","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","datePublished":"2012-12-03T08:00:13+00:00","dateModified":"2014-11-08T12:15:52+00:00","description":"Guava? This is the first in a series of posts where I'll be attempting to explain and explore Google's awesome Guava java library. I first came across","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/java-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/12\/google-guava-multimaps.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Google Guava MultiMaps"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/673556f9698e4cc973c6b2a033d526d9","name":"Tom Jefferys","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c18533c5fb898db45609a696474327815eb2fc647e934d3a87d87f0a7002173?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c18533c5fb898db45609a696474327815eb2fc647e934d3a87d87f0a7002173?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c18533c5fb898db45609a696474327815eb2fc647e934d3a87d87f0a7002173?s=96&d=mm&r=g","caption":"Tom Jefferys"},"sameAs":["http:\/\/tomjefferys.blogspot.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Tom-Jefferys"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/4008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/155"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=4008"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/4008\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/148"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=4008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=4008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=4008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}