added Methods in TaskListModel

added Field Crop ID in Task
added method removeTasksforCrop
This commit is contained in:
schrom01
2022-10-31 14:30:42 +01:00
parent 007fc81b22
commit d1d9d11b66
6 changed files with 44 additions and 8 deletions
@@ -1,5 +1,6 @@
package ch.zhaw.gartenverwaltung.io;
import ch.zhaw.gartenverwaltung.types.Crop;
import ch.zhaw.gartenverwaltung.types.Task;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
@@ -51,6 +52,16 @@ public class JsonTaskDatabase implements TaskDatabase{
return taskMap.values().stream().filter(task -> task.isInTimePeriode(start, end)).toList();
}
@Override
public List<Task> getTaskForCrop(Crop crop) {
return null; //TODO implement
}
@Override
public void removeTasksForCrop(Crop crop) {
// TODO implement
}
/**
* If no data is currently loaded, data is loaded from {@link #dataSource}.
* If the {@link Task} has an id than the task is added to the {@link #taskMap}
@@ -1,5 +1,6 @@
package ch.zhaw.gartenverwaltung.io;
import ch.zhaw.gartenverwaltung.types.Crop;
import ch.zhaw.gartenverwaltung.types.HardinessZone;
import ch.zhaw.gartenverwaltung.types.Plant;
import ch.zhaw.gartenverwaltung.types.Task;
@@ -24,6 +25,10 @@ public interface TaskDatabase {
*/
List<Task> getTaskList(LocalDate start, LocalDate end) throws IOException;
List<Task> getTaskForCrop(Crop crop); //TODO Javadoc
void removeTasksForCrop(Crop crop); // TODO Javadoc
/**
* Saves the {@link Task} in the Cache.
*