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());
    }

    /**
     * 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();
    }

}

@@ -1444,36 +1444,32 @@
 ) %7B%0A            
-    
 builder.append(%22
@@ -1478,28 +1478,24 @@
 riority: %22)%0A
-    
             
@@ -1572,36 +1572,32 @@
 ().isEmpty()) %7B%0A
-    
             buil
@@ -1627,36 +1627,32 @@
  %22)%0A            
-    
 .append(getStart
@@ -1724,36 +1724,32 @@
 ) %7B%0A            
-    
 builder.append(%22
@@ -1753,36 +1753,32 @@
 d(%22 DueDate: %22)%0A
-    
             .app
@@ -1854,36 +1854,32 @@
 ) %7B%0A            
-    
 builder.append(%22
@@ -1889,16 +1889,20 @@
 gs: %22);%0A
+    
         

Fix indentation