package seedu.ezdo.model.todo;

import java.util.Objects;

import seedu.ezdo.commons.util.CollectionUtil;
import seedu.ezdo.model.tag.UniqueTagList;

/**
 * Represents a Task in ezDo.
 * Guarantees: details are present and not null, field values are validated.
 */
public class Task implements ReadOnlyTask {

    private Name name;
    private Priority priority;
    private Email email;
    private StartDate startDate;

    private UniqueTagList tags;

    /**
     * Every field must be present and not null.
     */
    public Task(Name name, Priority priority, Email email, StartDate startDate, UniqueTagList tags) {
        assert !CollectionUtil.isAnyNull(name, priority, email, startDate, tags);
        this.name = name;
        this.priority = priority;
        this.email = email;
        this.startDate = startDate;
        this.tags = new UniqueTagList(tags); // protect internal tags from changes in the arg list
    }

    /**
     * Creates a copy of the given ReadOnlyTask.
     */
    public Task(ReadOnlyTask source) {
        this(source.getName(), source.getPriority(), source.getEmail(), source.getStartDate(), source.getTags());
    }

    public void setName(Name name) {
        assert name != null;
        this.name = name;
    }

    @Override
    public Name getName() {
        return name;
    }

    public void setPriority(Priority priority) {
        assert priority != null;
        this.priority = priority;
    }

    @Override
    public Priority getPriority() {
        return priority;
    }

    public void setEmail(Email email) {
        assert email != null;
        this.email = email;
    }

    @Override
    public Email getEmail() {
        return email;
    }

    public void setStartDate(StartDate startDate) {
        assert startDate != null;
        this.startDate = startDate;
    }

    @Override
    public StartDate getStartDate() {
        return startDate;
    }

    @Override
    public UniqueTagList getTags() {
        return new UniqueTagList(tags);
    }

    /**
     * Replaces this task's tags with the tags in the argument tag list.
     */
    public void setTags(UniqueTagList replacement) {
        tags.setTags(replacement);
    }

    /**
     * Updates this task with the details of {@code replacement}.
     */
    public void resetData(ReadOnlyTask replacement) {
        assert replacement != null;

        this.setName(replacement.getName());
        this.setPriority(replacement.getPriority());
        this.setEmail(replacement.getEmail());
        this.setStartDate(replacement.getStartDate());
        this.setTags(replacement.getTags());
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof ReadOnlyTask // instanceof handles nulls
                && this.isSameStateAs((ReadOnlyTask) other));
    }

    @Override
    public int hashCode() {
        // use this method for custom fields hashing instead of implementing your own
        return Objects.hash(name, priority, email, startDate, tags);
    }

    @Override
    public String toString() {
        return getAsText();
    }

}

@@ -414,16 +414,45 @@
 artDate;
+%0A    private DueDate dueDate;
 %0A%0A    pr
@@ -622,16 +622,33 @@
 artDate,
+ DueDate dueDate,
  UniqueT
@@ -864,24 +864,56 @@
  startDate;%0A
+        this.dueDate = dueDate;%0A
         this
@@ -1200,24 +1200,45 @@
 StartDate(),
+ source.getDueDate(),
  source.getT
@@ -1981,24 +1981,24 @@
 artDate() %7B%0A
-
         retu
@@ -2008,32 +2008,232 @@
 startDate;%0A    %7D
+%0A    %0A    public void setDueDate(DueDate dueDate) %7B%0A        assert dueDate != null;%0A        this.dueDate = dueDate;%0A    %7D%0A%0A    @Override%0A    public DueDate getDueDate() %7B%0A        return dueDate;%0A    %7D
 %0A%0A    @Override%0A

Add DueDate in Task constructor; Add mutuator and accessor for DueDate