package seedu.geekeep.storage;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;

import seedu.geekeep.commons.exceptions.IllegalValueException;
import seedu.geekeep.model.tag.Tag;
import seedu.geekeep.model.tag.UniqueTagList;
import seedu.geekeep.model.task.DateTime;
import seedu.geekeep.model.task.Location;
import seedu.geekeep.model.task.ReadOnlyTask;
import seedu.geekeep.model.task.Task;
import seedu.geekeep.model.task.Title;

/**
 * JAXB-friendly version of the Task.
 */
public class XmlAdaptedTask {

    @XmlElement(required = true)
    private String title;
    @XmlElement(required = true)
    private String startDateTime;
    @XmlElement(required = true)
    private String endDateTime;
    @XmlElement(required = true)
    private String location;

    @XmlElement
    private List<XmlAdaptedTag> tagged = new ArrayList<>();

    /**
     * Constructs an XmlAdaptedTask.
     * This is the no-arg constructor that is required by JAXB.
     */
    public XmlAdaptedTask() {}


    /**
     * Converts a given Task into this class for JAXB use.
     *
     * @param source future changes to this will not affect the created XmlAdaptedTask
     */
    public XmlAdaptedTask(ReadOnlyTask source) {
        title = source.getTitle().fullTitle;
        endDateTime = source.getEndDateTime() == null ? "" : source.getEndDateTime().value;
        startDateTime = source.getStartDateTime() == null ? "" : source.getStartDateTime().value;
        location = source.getLocation() == null ? "" : source.getLocation().value;
        tagged = new ArrayList<>();
        for (Tag tag : source.getTags()) {
            tagged.add(new XmlAdaptedTag(tag));
        }
    }

    /**
     * Converts this jaxb-friendly adapted task object into the model's Task object.
     *
     * @throws IllegalValueException if there were any data constraints violated in the adapted task
     */
    public Task toModelType() throws IllegalValueException {
        final List<Tag> taskTags = new ArrayList<>();
        for (XmlAdaptedTag tag : tagged) {
            taskTags.add(tag.toModelType());
        }
        final Title title = new Title(this.title);
        final DateTime endDateTime = this.endDateTime.isEmpty() ? null : new DateTime(this.endDateTime);
        final DateTime startDateTime = this.startDateTime.isEmpty() ? null : new DateTime(this.startDateTime);
        final Location location = this.location.isEmpty() ? null : new Location(this.location);
        final UniqueTagList tags = new UniqueTagList(taskTags);
        return new Task(title, startDateTime, endDateTime, location, tags);
    }
}

@@ -806,17 +806,16 @@
 cation;%0A
-%0A
     @Xml
@@ -881,16 +881,59 @@
 ist%3C%3E();
+%0A    @XmlElement%0A    private String isDone;
 %0A%0A    /*
@@ -1745,24 +1745,77 @@
 ;%0A        %7D%0A
+        isDone = source.isDone() ? %22True%22 : %22False%22;%0A
     %7D%0A%0A    /
@@ -2654,24 +2654,83 @@
 (taskTags);%0A
+        final boolean isDone = this.isDone.equals(%22True%22);%0A
         retu
@@ -2790,16 +2790,24 @@
 on, tags
+, isDone
 );%0A    %7D

Add field isDone in class XmlAdaptedTask