3
I have a class Pessoa
that has the columns Integer id
. String name
, and String date_born
.
In my main Activity I am already retrieving the list of people that comes from my request made in the API and already send to my function to group.
private void loadList(List<Pessoas> listPessoas){
Map<String, List<Pessoas>> listMap = listPessoas.stream().collect(Collectors.groupingBy(Pessoa::getDate_born)); //LISTA AGRUPADA
}
But I need to filter the list before I can group through the field date_born
, There goes my question.
private void loadList(List<Pessoas> listPessoas){
List<Pessoas> listPessoasFiltered = ??
Map<String, List<Pessoas>> listMap = listPessoasFiltered.stream().collect(Collectors.groupingBy(Pessoa::getDate_born));
}
There is already a type function .filter()
that returns the list or has to implement a filter function to return my filtered people list before grouping people by this field?
Remembering is not within an Adapter is a list filter.
I’m crying with happiness, I thought I needed to create a function for it , now that I saw that there is a ready one just use vlw.
– Ricardo Lucas