package seedu.tasklist.model.task;

import java.util.Objects;

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

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

    private Name name;
    private Comment comment;
    private Priority priority;
    private Status status;

    private UniqueTagList tags;

    /**
     * Every field must be present and not null.
     */
    public Task(Name name, Comment comment, Priority priority, Status status, UniqueTagList tags) {
        assert !CollectionUtil.isAnyNull(name, comment, priority, status, tags);
        this.name = name;
        this.comment = comment;
        this.priority = priority;
        this.status = status;
        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.getComment(), source.getPriority(), source.getStatus(), source.getTags());
    }

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

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


    public void setComment(Comment comment) {
        assert comment != null;
        this.comment = comment;
    }

    @Override
    public Comment getComment() {
        return comment;
    }

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

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

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

    public void setStatus(Status status) {
        assert status != null;
        this.status = status;
    }

    @Override
    public Status getStatus() {
        return status;
    }

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

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

        this.setName(replacement.getName());
        this.setComment(replacement.getComment());
        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, comment, tags);
    }

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

}

@@ -33,86 +33,8 @@
 k;%0A%0A
-import java.util.Objects;%0A%0Aimport seedu.tasklist.commons.util.CollectionUtil;%0A
 impo
@@ -264,1025 +264,105 @@
    p
-rivate Name name;%0A    private Comment comment;%0A    private Priority priority;%0A    private Status status;%0A%0A    private UniqueTagList tags;%0A%0A    /**%0A     * Every field must be present and not null.%0A     */%0A    public Task(Name name, Comment comment, Priority priority, Status status, UniqueTagList tags) %7B%0A        assert !CollectionUtil.isAnyNull(name, comment, priority, status, tags);%0A        this.name = name;%0A        this.comment = comment;%0A        this.priority = priority;%0A        this.status = status;%0A        this.tags = new UniqueTagList(tags); // protect internal tags from changes in the arg list%0A    %7D%0A%0A    /**%0A     * Creates a copy of the given ReadOnlyTask.%0A     */%0A    public Task(ReadOnlyTask source) %7B%0A        this(source.getName(), source.getComment(), source.getPriority(), source.getStatus(), source.getTags());%0A    %7D%0A%0A    public void setName(Name name) %7B%0A        assert name != null;%0A        this.name = name;%0A    %7D%0A%0A    @Override%0A    public Name getName() %7B%0A        return name;%0A    %7D%0A%0A%0A    public
+ublic abstract void setName(Name name);%0A%0A    public abstract Name getName();%0A%0A    public abstract
  voi
@@ -394,230 +394,73 @@
 ent)
- %7B
+;%0A
 %0A    
-    assert comment != null;%0A        this.comment = comment;%0A    %7D%0A%0A    @Override%0A    public Comment getComment() %7B%0A        return comment;%0A    %7D%0A%0A    @Override%0A    public UniqueTagList getTags() %7B%0A        return new
+public abstract Comment getComment();%0A%0A    public abstract
  Uni
@@ -473,21 +473,19 @@
 List
-(t
+ getT
 ags
+(
 );
-%0A    %7D
 %0A%0A  
@@ -485,32 +485,41 @@
 ();%0A%0A    public 
+abstract 
 void setPriority
@@ -541,165 +541,54 @@
 ity)
- %7B%0A        assert priority != null;%0A        this.priority = priority;%0A    %7D%0A%0A    @Override%0A    public Priority getPriority() %7B%0A        return priority;%0A    %7D
+;%0A%0A    public abstract Priority getPriority();
 %0A%0A  
@@ -588,32 +588,41 @@
 ();%0A%0A    public 
+abstract 
 void setStatus(S
@@ -638,153 +638,50 @@
 tus)
- %7B%0A        assert status != null;%0A        this.status = status;%0A    %7D%0A%0A    @Override%0A    public Status getStatus() %7B%0A        return status;%0A    %7D
+;%0A%0A    public abstract Status getStatus();
 %0A%0A  
@@ -776,24 +776,33 @@
 %0A    public 
+abstract 
 void setTags
@@ -832,51 +832,9 @@
 ent)
- %7B%0A        tags.setTags(replacement);%0A    %7D
+;
 %0A%0A  
@@ -930,763 +930,58 @@
 lic 
-void resetData(ReadOnlyTask replacement) %7B%0A        assert replacement != null;%0A%0A        this.setName(replacement.getName());%0A        this.setComment(replacement.getComment());%0A        this.setTags(replacement.getTags());%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object other) %7B%0A        return other == this // short circuit if same object%0A                %7C%7C (other instanceof ReadOnlyTask // instanceof handles nulls%0A                && this.isSameStateAs((ReadOnlyTask) other));%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        // use this method for custom fields hashing instead of implementing your own%0A        return Objects.hash(name, comment, tags);%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return getAsText();%0A    %7D
+abstract void resetData(ReadOnlyTask replacement);
 %0A%0A%7D%0A

Update Task.java to be an abstract class