Reputation: 397
Is to possible to create a list of guava Multimap?
I created a regular Multimap as so, but was not able to create as list of Multimaps
Multimap<String, Integer> map = ArrayListMultimap.create();
Upvotes: 0
Views: 606
Reputation: 31878
You already have initialized the MultiMap
precisely using:
Multimap<String, Integer> map = ArrayListMultimap.create();
Now if you tend to implement a java.util.List
of such a MultiMap, you can simply initialise it as:
java.util.List<MultiMap<String, Integer>> listOfMap = new ArrayList<>();
// array list initialisation within which the multimap can be initialised using previous code
listOfMap.add(map);
Upvotes: 2