I'm trying to pass HashMap < String, List< MyModelClass>> from Spring Rest Controller. From the Rest Controller the values are returned as expected. But when the client receives the returned object is resulting in HashMap < String, List< LinkedHashMap>> instead HashMap < String, List< MyModelClass>>.
Below is the call from client service method.
Map<String, List<MyModelClass>> map = new HashMap<String, List<MyModelClass>> ();
map = (Map<String, List<MyModelClass>>)restTemplate.getForObject(restURL + "/someMethod/"+parameter, HashMap.class);
What am I doing wrong here. How would I get the Map < String, List< MyModelClass>> in client service instead of Hashmap < String, List< LinkedHashMap>>. Please advise. Thanks.