package seedu.ezdo.commons.util;

import java.util.Optional;
import java.util.Set;

import seedu.ezdo.model.todo.Priority;
import seedu.ezdo.model.todo.TaskDate;

//@@author A0141010L
public class SearchParameters {

    private Set<String> namesToCompare;
    private Optional<Priority> priorityToCompare;
    private Optional<TaskDate> startDateToCompare;
    private Optional<TaskDate> dueDateToCompare;
    private Set<String> tagsToCompare;
    private boolean startBefore = false;
    private boolean dueBefore = false;
    private boolean startAfter = false;
    private boolean dueAfter = false;

    public Set<String> getNames() {
        return namesToCompare;
    }

    public Optional<Priority> getPriority() {
        return priorityToCompare;
    }

    public Optional<TaskDate> getStartDate() {
        return startDateToCompare;
    }

    public Optional<TaskDate> getDueDate() {
        return dueDateToCompare;
    }

    public Set<String> getTags() {
        return tagsToCompare;
    }

    public boolean getStartBefore() {
        return startBefore;
    }

    public boolean getdueBefore() {
        return dueBefore;
    }

    public boolean getStartAfter() {
        return startAfter;
    }

    public boolean getDueAfter() {
        return dueAfter;
    }

    public static class Builder {
        private Set<String> namesToCompare;
        private Optional<Priority> priorityToCompare;
        private Optional<TaskDate> startDateToCompare;
        private Optional<TaskDate> dueDateToCompare;
        private Set<String> tagsToCompare;
        private boolean startBefore = false;
        private boolean dueBefore = false;
        private boolean startAfter = false;
        private boolean dueAfter = false;

        public Builder name(Set<String> names) {
            namesToCompare = names;
            return this;
        }

        public Builder priority(Optional<Priority> priority) {
            priorityToCompare = priority;
            return this;
        }

        public Builder startDate(Optional<TaskDate> findStartDate) {
            startDateToCompare = findStartDate;
            return this;
        }

        public Builder dueDate(Optional<TaskDate> dueDate) {
            dueDateToCompare = dueDate;
            return this;
        }

        public Builder tags(Set<String> tags) {
            tagsToCompare = tags;
            return this;
        }

        public Builder startBefore(boolean before) {
            startBefore = before;
            return this;
        }

        public Builder dueBefore(boolean before) {
            dueBefore = before;
            return this;
        }

        public Builder startAfter(boolean after) {
            startAfter = after;
            return this;
        }

        public Builder dueAfter(boolean after) {
            dueAfter = after;
            return this;
        }

        public SearchParameters build() {
            return new SearchParameters(this);
        }
    }

    private SearchParameters(Builder builder) {
        namesToCompare = builder.namesToCompare;
        priorityToCompare = builder.priorityToCompare;
        startDateToCompare = builder.startDateToCompare;
        dueDateToCompare = builder.dueDateToCompare;
        tagsToCompare = builder.tagsToCompare;
        startBefore = builder.startBefore;
        dueBefore = builder.dueBefore;
        startAfter = builder.startAfter;
        dueAfter = builder.dueAfter;
    }
}

@@ -116,16 +116,52 @@
 iority;%0A
+import seedu.ezdo.model.todo.Recur;%0A
 import s
@@ -191,16 +191,16 @@
 skDate;%0A
-
 %0A//@@aut
@@ -428,32 +428,76 @@
 eDateToCompare;%0A
+    private Optional%3CRecur%3E recurToCompare;%0A
     private Set%3C
@@ -1005,32 +1005,110 @@
 Compare;%0A    %7D%0A%0A
+    public Optional%3CRecur%3E getRecur() %7B%0A        return recurToCompare;%0A    %7D%0A%0A
     public Set%3CS
@@ -1675,32 +1675,80 @@
 eDateToCompare;%0A
+        private Optional%3CRecur%3E recurToCompare;%0A
         private 
@@ -2493,32 +2493,158 @@
 his;%0A        %7D%0A%0A
+        public Builder recur(Optional%3CRecur%3E recur) %7B%0A            recurToCompare = recur;%0A            return this;%0A        %7D%0A%0A
         public B
@@ -3528,32 +3528,32 @@
 tDateToCompare;%0A
-
         dueDateT
@@ -3581,32 +3581,81 @@
 eDateToCompare;%0A
+        recurToCompare = builder.recurToCompare;%0A
         tagsToCo

Improve Searchparameters to include Recur