An Abstract controller class requires List of objects from REST. While using Spring RestTemplate its not mapping it to required class instead it returns Linked HashMAp
Couldnt find a solution from Spring, hence I have done it with ParameterizedTypeReference in HashMap like
public final static HashMap paramTypeRefMap = new HashMap() ;
static {
paramTypeRefMap.put(AttributeDefinition.class, new ParameterizedTypeReference>(){} );
paramTypeRefMap.put(AttributeInfo.class, new ParameterizedTypeReference>(){} );
}
and used it
ParameterizedTypeReference parameterizedTypeReference = paramTypeRefMap.get(requiredClass);
ResponseEntity exchange = restTemplate.exchange(uri, HttpMethod.POST, entity, parameterizedTypeReference);