diff --git a/app/src/main/java/com/example/citrusclient/models/Todo.java b/app/src/main/java/com/example/citrusclient/models/Todo.java index 10a9733..8458c6b 100644 --- a/app/src/main/java/com/example/citrusclient/models/Todo.java +++ b/app/src/main/java/com/example/citrusclient/models/Todo.java @@ -1,5 +1,7 @@ package com.example.citrusclient.models; +import java.util.List; + public class Todo { String title; @@ -50,5 +52,12 @@ } public Integer getBookId(){return bookId;} - + public boolean containsTodo(List todoList){ + for(Todo todo : todoList) { + if(todo.bookId == this.bookId && todo.year == this.year && todo.month == this.month && todo.day == this.day && todo.todoId == this.todoId) { + return true; + } + } + return false; + } }