I have this list of Entities:
@Entity
@Table(name = "filters")
public class Filters {
private String filter_settings;
private Integer position;
}
List:
List<RiskFilters> filter_list
I have simple numbers for 'position' - 1,2,3 and etc.
How I can sort the list of 'Filters' based on the 'position' number?
I tried this:
List<RiskFilters> sorted_filter_list = Collections.sort(filter_list, Comparator.comparingInt(RiskFilters::getPosition));
But I get Type mismatch: cannot convert from void to List
Is there some way to fix this?