package seedu.taskell.model.task;

import java.util.Objects;

import seedu.taskell.commons.exceptions.IllegalValueException;
import seedu.taskell.commons.util.CollectionUtil;
import seedu.taskell.model.tag.UniqueTagList;

/**
 * Represents a Task in the task manager.
 * Guarantees: details are present and not null, field values are validated.
 */
public class Task implements ReadOnlyTask {
    public static final String FLOATING_TASK = "FLOATING";
    public static final String DEADLINE_TASK = "DEADLINE";
    public static final String EVENT_TASK = "EVENT";

    private Description description;
    private String taskType;
    private TaskDate startDate;
    private TaskDate endDate;
    private TaskTime startTime;
    private TaskTime endTime;
    private TaskPriority taskPriority;

    private UniqueTagList tags;

    /**
     * Every field must be present and not null.
     */
    public Task(Description description, String taskType, TaskDate startDate, TaskDate endDate, TaskTime startTime, TaskTime endTime, TaskPriority taskPriority, UniqueTagList tags) {
        assert !CollectionUtil.isAnyNull(description, taskType, startDate, startTime, endTime, taskPriority, tags);
        this.description = description;
        this.taskType = taskType;
        this.startDate = startDate;
        this.endDate = endDate;
        this.endDate = endDate;
        this.startTime = startTime;
        this.endTime = endTime;
        this.taskPriority = taskPriority;
        this.tags = new UniqueTagList(tags); // protect internal tags from changes in the arg list
    }

    public Task(String description) throws IllegalValueException{
        this.description = new Description(description);
    }
    /**
     * Copy constructor.
     */
    public Task(ReadOnlyTask source) {
        this(source.getDescription(), source.getTaskType(), source.getStartDate(), source.getEndDate(), source.getStartTime(), source.getEndTime(), source.getTaskPriority(), source.getTags());
    }

    @Override
    public Description getDescription() {
        return description;
    }
    
    @Override
    public String getTaskType() {
        return taskType;
    }

    @Override
    public TaskDate getStartDate() {
        return startDate;
    }
    
    @Override
    public TaskDate getEndDate() {
        return endDate;
    }

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

    @Override
    public TaskPriority getTaskPriority() {
        return taskPriority;
    }

    @Override
    public UniqueTagList getTags() {
        return new UniqueTagList(tags);
    }
   
    /**
     * Replaces this task'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(description, startDate, startTime, endTime, taskPriority, tags);
    }

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

}

@@ -564,21 +564,23 @@
 %0A%0A    pr
-ivate
+otected
  Descrip
@@ -603,21 +603,23 @@
 ;%0A    pr
-ivate
+otected
  String 
@@ -626,37 +626,39 @@
 taskType;%0A    pr
-ivate
+otected
  TaskDate startD
@@ -664,29 +664,31 @@
 Date;%0A    pr
-ivate
+otected
  TaskDate en
@@ -692,37 +692,39 @@
  endDate;%0A    pr
-ivate
+otected
  TaskTime startT
@@ -730,29 +730,31 @@
 Time;%0A    pr
-ivate
+otected
  TaskTime en
@@ -766,21 +766,23 @@
 ;%0A    pr
-ivate
+otected
  TaskPri
@@ -812,13 +812,15 @@
   pr
-ivate
+otected
  Uni

Change access to protected