package seedu.taskitty.model.task;

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

import java.util.Objects;

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

    private Name name;
    private TaskDate date;
    private TaskTime startTime;
    private TaskTime endTime;

    private UniqueTagList tags;

    /**
     * Every field must be present and not null.
     */
    public Task(Name name, UniqueTagList tags) {
        assert !CollectionUtil.isAnyNull(name, tags);
        this.name = name;
        this.tags = new UniqueTagList(tags); // protect internal tags from changes in the arg list
    }

    /**
     * Copy constructor.
     */
    public Task(ReadOnlyTask source) {
        this(source.getName(), source.getTags());
    }

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

    @Override
    public TaskTime getStartTime() {
        return startTime;
    }

    @Override
    public TaskTime getEndTime() {
        return endTime;
    }

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

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

    @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, tags);
    }

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

@@ -325,16 +325,700 @@
 lyTask %7B
+%0A    %0A    public static final int TASK_COMPONENT_INDEX_NAME = 0;%0A    public static final int TASK_COMPONENT_COUNT = 1;%0A    %0A    public static final int DEADLINE_COMPONENT_INDEX_NAME = 0;%0A    public static final int DEADLINE_COMPONENT_INDEX_DATE = 1;%0A    public static final int DEADLINE_COMPONENT_INDEX_END_TIME = 2;%0A    public static final int DEADLINE_COMPONENT_COUNT = 3;%0A    %0A    public static final int EVENT_COMPONENT_INDEX_NAME = 0;%0A    public static final int EVENT_COMPONENT_INDEX_DATE = 1;%0A    public static final int EVENT_COMPONENT_INDEX_START_TIME = 2;%0A    public static final int EVENT_COMPONENT_INDEX_END_TIME = 3;%0A    public static final int EVENT_COMPONENT_COUNT = 4;
 %0A%0A    pr

Add constants