package seedu.address.model.task;

import java.time.LocalDateTime;
import java.util.Objects;

import seedu.address.commons.exceptions.IllegalValueException;

public class DeadlineTask extends Task {

    private static final String FMT_STRING = "DeadlineTask[name=%s, due=%s]";

    private final LocalDateTime due;

    public DeadlineTask(Name name, LocalDateTime due) {
        super(name);
        assert due != null;
        this.due = due;
    }

    public DeadlineTask(String name, LocalDateTime due) throws IllegalValueException {
        this(new Name(name), due);
    }

    public LocalDateTime getDue() {
        return due;
    }

    @Override
    public boolean equals(Object other) {
        return other == this
               || (other instanceof DeadlineTask
               && name.equals(((DeadlineTask)other).name)
               && due.equals(((DeadlineTask)other).due));
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, due);
    }

    @Override
    public String toString() {
        return String.format(FMT_STRING, name, due);
    }

}

@@ -87,16 +87,54 @@
 jects;%0A%0A
+import java.util.function.Predicate;%0A%0A
 import s
@@ -305,16 +305,29 @@
 , due=%25s
+, finished=%25s
 %5D%22;%0A%0A   
@@ -361,16 +361,167 @@
 e due;%0A%0A
+    private boolean finished;%0A%0A    public static Predicate%3C? super DeadlineTask%3E isNotFinishedDeadline() %7B%0A        return p -%3E !p.isFinished();%0A    %7D%0A%0A
     publ
@@ -564,16 +564,34 @@
 Time due
+, boolean finished
 ) %7B%0A    
@@ -655,24 +655,153 @@
 .due = due;%0A
+        this.finished = finished;%0A    %7D%0A%0A    public DeadlineTask(Name name, LocalDateTime due) %7B%0A        this(name, due, false);%0A
     %7D%0A%0A    p
@@ -910,24 +910,31 @@
 e(name), due
+, false
 );%0A    %7D%0A%0A  
@@ -986,32 +986,214 @@
 urn due;%0A    %7D%0A%0A
+    public boolean isFinished() %7B%0A        return this.finished;%0A    %7D%0A%0A    public void markAsFinished() %7B%0A        assert this.finished == false;%0A        this.finished = true;%0A    %7D%0A%0A
     @Override%0A  
@@ -1609,28 +1609,38 @@
 TRING, name, due
+, finished
 );%0A    %7D%0A%0A%7D%0A

isFinished attribute added in DeadlineTask