Issue
I need to create an object of type MultiValueMap
package org.springframework.util;
public interface MultiValueMap<K, V> extends Map<K, List<V>> {
and use it as a HashMap. What object shall I use? I tried HashMap but it didn't work.
Solution
According to these docs: https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/MultiValueMap.html, there are several classes that implement this interface.
You don't specify the context of what you need the class for so we can't tell you which one you should use. The most general one appears to be org.springframework.util.LinkedMultiValueMap
(https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/LinkedMultiValueMap.html).
Answered By - pcarter
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.