package seedu.jimi.model.task;

import seedu.jimi.model.datetime.DateTime;
import seedu.jimi.model.tag.UniqueTagList;

public class DeadlineTask extends FloatingTask implements ReadOnlyTask {

    private DateTime deadline;
    
    public DeadlineTask(Name name, DateTime deadline, UniqueTagList tags, boolean isCompleted) {
        super(name, tags, isCompleted);
        assert deadline != null;
        this.deadline = deadline;
    }
    
    public DeadlineTask(Name name, DateTime deadline, UniqueTagList tags) {
        super(name, tags);
        assert deadline != null;
        this.deadline = deadline;
    }
    
    /**
     * Copy constructor.
     */
    public DeadlineTask(DeadlineTask source) {
        super(source.getName(), source.getTags(), source.isCompleted());
        this.deadline = ((DeadlineTask) source).getDeadline();
    }
    
    
    public DateTime getDeadline() {
        return deadline;
    }

    @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 boolean isSameStateAs(ReadOnlyTask other) {
        return other == this // short circuit if same object
                || (other instanceof DeadlineTask // instanceof handles nulls
                && super.isSameStateAs(other)
                && ((DeadlineTask)other).getDeadline().equals(this.getDeadline())
                );
    }
    
    @Override
    public String toString() {
        return getAsText();
    }

    @Override
    public String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getName())
               .append(" ")
               .append(getDeadline())
               .append(" Tags: ");
        getTags().forEach(builder::append);
        return builder.toString();
    }
    

}

@@ -68,16 +68,54 @@
 teTime;%0A
+import seedu.jimi.model.tag.Priority;%0A
 import s
@@ -353,16 +353,35 @@
 ompleted
+, Priority priority
 ) %7B%0A    
@@ -413,16 +413,26 @@
 ompleted
+, priority
 );%0A     
@@ -576,16 +576,35 @@
 ist tags
+, Priority priority
 ) %7B%0A    
@@ -623,16 +623,26 @@
 me, tags
+, priority
 );%0A     
@@ -872,16 +872,38 @@
 pleted()
+, source.getPriority()
 );%0A     
@@ -2038,16 +2038,86 @@
 ppend);%0A
+        builder.append(%22 Priority: %22)%0A        .append(getPriority());%0A
         

Implement Priority in DeadlineTask