package seedu.ezdo.model.todo;

import seedu.ezdo.model.tag.UniqueTagList;

/**
 * A read-only immutable interface for a Task in ezDo.
 * Implementations should guarantee: details are present and not null, field values are validated.
 */
public interface ReadOnlyTask {

    Name getName();
    Priority getPriority();
    TaskDate getStartDate();
    TaskDate getDueDate();
    boolean getDone();

    /**
     * The returned TagList is a deep copy of the internal TagList,
     * changes on the returned list will not affect the task's internal tags.
     */
    UniqueTagList getTags();

    /**
     * Returns true if both have the same state. (interfaces cannot override .equals)
     */
    default boolean isSameStateAs(ReadOnlyTask other) {
        return other == this // short circuit if same object
                || (other != null // this is first to avoid NPE below
                && other.getName().equals(this.getName()) // state checks here onwards
                && other.getPriority().equals(this.getPriority())
                && other.getStartDate().equals(this.getStartDate()))
                && other.getDueDate().equals(this.getDueDate());
    }
  //@@author A0139248X
    /**
     * Formats the task as text, showing all contact details.
     */
    default String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append("Task: ").append(getName());
        if (!getPriority().toString().isEmpty()) {
            builder.append(" Priority: ").append(getPriority());
        }
        if (!getStartDate().toString().isEmpty()) {
            builder.append(" StartDate: ").append(getStartDate());
        }
        if (!getDueDate().toString().isEmpty()) {
            builder.append(" DueDate: ").append(getDueDate());
        }
        if (!getTags().toSet().isEmpty()) {
            builder.append(" Tags: ");
            getTags().forEach(builder::append);
        }
        return builder.toString();
    }
}

@@ -1246,15 +1246,12 @@
 all 
-contact
+task
  det
@@ -1256,16 +1256,113 @@
 etails.%0A
+     * Will only show what the task has. i.e. if task has no priority it won't show %22Priority: %22%0A
      */%0A
@@ -1480,25 +1480,8 @@
 end(
-%22Task: %22).append(
 getN
@@ -1567,16 +1567,18 @@
 append(%22
+ %7C
  Priorit
@@ -1696,16 +1696,18 @@
 append(%22
+ %7C
  StartDa
@@ -1825,16 +1825,18 @@
 append(%22
+ %7C
  DueDate
@@ -1944,16 +1944,18 @@
 append(%22
+ %7C
  Tags: %22

Update comments Improve look of command result