[Solved] how sort in java8 list of lists of object by multiple properties [duplicate]

[ad_1]

Just use comparator, an example of sorting by firstName then by lastName

list.forEach(l -> l.sort(Comparator.comparing(CsvEntity::getFirstName)
                               .thenComparing(CsvEntity::getLastName)));

Of course you have to have getters for your fields to use method reference

[ad_2]

solved how sort in java8 list of lists of object by multiple properties [duplicate]