package seedu.taskmanager.model.task;

import java.util.logging.Logger;

import seedu.taskmanager.commons.core.LogsCenter;


// @@author A0114269E
/**
 * Represents a Task's status in the task manager.
 * @param true for task that is done
 * @param false for task yet to be done
 */
public class Status {
    private static final Logger logger = LogsCenter.getLogger(Status.class);

    private static final String MESSAGE_STATUS_DONE = "Done";
    private static final String MESSAGE_STATUS_NOT_DONE = "Incomplete";

    public boolean value;

    /**
     * Default constructor
     */
    public Status() {
        value = false;
    }

    /**
     * For copy operation
     */
    public Status(boolean status) {
        this.value = status;
    }

    /**
     * To recreate model from storage in String
     */
    public Status(String status) {
        assert status != null;
        if (status.equals(MESSAGE_STATUS_DONE)) {
            this.value = true;
        } else if (status.equals(MESSAGE_STATUS_NOT_DONE)) {
            this.value = false;
        } else {
            this.value = false;
            logger.warning("Unknown Status String, status default to Incomplete");
        }
    }

    @Override
    public String toString() {
        if (value) {
            return MESSAGE_STATUS_DONE;
        } else {
            return MESSAGE_STATUS_NOT_DONE;
        }
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof Status // instanceof handles nulls
                        && this.toString().equals(((Status) other).toString())); // state
        // check
    }
}
//@@author

@@ -877,16 +877,123 @@
 = null;%0A
+        this.value = Status.toBoolean(status);%0A    %7D%0A%0A    public static boolean toBoolean(String status) %7B%0A
         
@@ -1046,28 +1046,23 @@
         
-this.value =
+ return
  true;%0A 
@@ -1129,36 +1129,30 @@
             
-this.value =
+return
  false;%0A    
@@ -1168,40 +1168,8 @@
 e %7B%0A
-            this.value = false;%0A
     
@@ -1247,16 +1247,42 @@
 lete%22);%0A
+            return false;%0A
         

Refactor toBoolean in Status