Exemplo n.º 1
0
 public List<CountryDto> getAll() {
   return countryRepository
       .findAll()
       .stream()
       .map(countryAssembler.convertCountryToDto())
       .collect(Collectors.toList());
 }
Exemplo n.º 2
0
 @Cacheable("countriesCache")
 public List<CountryDto> getByName(String name) {
   Preconditions.checkArgument(StringUtils.isNotBlank(name), "Name cannot be blank");
   return countryRepository
       .findByName(name)
       .stream()
       .map(countryAssembler.convertCountryToDto())
       .collect(Collectors.toList());
 }