irus
01/04/2017, 2:36 PMThat allows to provide convenient API for RestTemplate (thanks to Jon Schneider from Netflix for contributing this). For example, to retrieve a list of Foo objects in Java you have to write:List<Foo> result = restTemplate.exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<List<Foo>>() { }).getBody();
While in Kotlin with Spring Framework 5 extensions you will be able to write:can be wrote in more nice way in java:val result : List<Foo> = restTemplate.getForObject(url)
List<Foo> result = Arrays.asList(restTemplate.getForObject(url, Foo[].class))