6
private List<String> getPermissoes(TipoUsuario tipoUsuario) {
List<String> permissoes = new ArrayList();
for (Permissao permissao : tipoUsuario.getPermissoes()) {
permissoes.add(permissao.getNome());
}
return permissoes;
}
I would like to implement this ai with more style using functional programming. I tried the following...
tipoUsuario.getPermissoes().stream().map(permissao -> Permissao::getNome()).collect();
It’s wrong, I know, but that’s the idea. Please help.
Perfect. That’s what I call more style. Vlw @hkotsubo. Thank you so much for vdd
– Maykon Oliveira