private List<String> getPermissoes(TipoUsuario tipoUsuario) {
List<String> permissoes = new ArrayList();
for (Permissao permissao : tipoUsuario.getPermissoes()) {
permissoes.add(permissao.getNome());
}
return permissoes;
}
I'd like to implement it there with more style using functional programming. I tried the following ...
tipoUsuario.getPermissoes().stream().map(permissao -> Permissao::getNome()).collect();
It's wrong, I know, but the idea is this. Help please.