created sortByNextExecution Comparator

This commit is contained in:
schrom01 2022-11-25 13:01:38 +01:00
parent f389cfcdfd
commit c9ba9c1234
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ public class GardenSchedule {
* Comparators to create sorted Task List * Comparators to create sorted Task List
*/ */
static final Comparator<Task> sortByStartDate = Comparator.comparing(Task::getStartDate); static final Comparator<Task> sortByStartDate = Comparator.comparing(Task::getStartDate);
static final Comparator<Task> sortByNextExecution = Comparator.comparing(Task::getNextExecution);
/** /**
* Constructor to create Database Objects. * Constructor to create Database Objects.
@ -176,7 +177,7 @@ public class GardenSchedule {
* @throws IOException If the database cannot be accessed * @throws IOException If the database cannot be accessed
*/ */
public List<Task> getFilteredTaskList(LocalDate start, LocalDate end) throws IOException { public List<Task> getFilteredTaskList(LocalDate start, LocalDate end) throws IOException {
return getSortedTaskList(taskList.getTaskList(start, end), sortByStartDate); return getSortedTaskList(taskList.getTaskList(start, end), sortByNextExecution);
} }
/** /**