-4

In java,want to get the values for a given key in multimap of guava and apache commons. say MultiMap dbOutput and now want to get all the values for the key "key" which is present in dbOutput.

shaheer01
  • 111
  • 2
  • 11
  • 4
    Which MultiMap? Guava? Your own? – vikingsteve Jan 08 '20 at 11:24
  • You can google for *how to implement multimap*. In case you are using given solution for such collection, it most likely has `get` method which returns array of values for a given key – Steyrix Jan 08 '20 at 11:29

2 Answers2

1

If this multiMap is guaua multimap then All the values can be retrieved in the form of collection using Multimap.get(key).

For more details please go through below link: https://github.com/google/guava/wiki/NewCollectionTypesExplained

Ankur Gupta
  • 312
  • 1
  • 3
1

I assume that you're talking about Guava. Please, refer to link about Guava MultiMap. It provides a get(Key k) method to retrieve a collection of all values assigned to the given key.

Regards,

Mohammed Deifallah
  • 1,290
  • 1
  • 10
  • 25