package seedu.task.model.task;

import seedu.task.model.tag.UniqueTagList;

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

    Title getTitle();
    Description getDescription();
    StartDate getStartDate();
    DueDate getDueDate();
    Interval getInterval();
    TimeInterval getTimeInterval();
    Status getStatus();
    void setStatus(Status status);
    /**
     * 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.getTitle().equals(this.getTitle()) // state checks here onwards
                && other.getDescription().equals(this.getDescription())
                && other.getStartDate().equals(this.getStartDate())
                && other.getDueDate().equals(this.getDueDate())
                && other.getInterval().equals(this.getInterval())
                && other.getTimeInterval().equals(this.getTimeInterval())
                && other.getStatus().equals(this.getStatus()));
    }

    /**
     * Formats the task as text, showing all contact details.
     */
    default String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getTitle())
                .append(" Description: ")
                .append(getDescription())
                .append(" Start Date: ")
                .append(getStartDate())
                .append(" Due Date: ")
                .append(getDueDate())
                .append(" Interval: ")
                .append(getInterval())
                .append(" Time Interval: ")
                .append(getTimeInterval())
                .append(" Status: ")
                .append(getStatus())
                .append(" Tags: ");
        getTags().forEach(builder::append);
        return builder.toString();
    }

    /**
     * Returns a string representation of this Task's tags
     */
    default String tagsString() {
        final StringBuffer buffer = new StringBuffer();
        final String separator = ", ";
        getTags().forEach(tag -> buffer.append(tag).append(separator));
        if (buffer.length() == 0) {
            return "";
        } else {
            return buffer.substring(0, buffer.length() - separator.length());
        }
    }

}

@@ -1946,173 +1946,8 @@
 ())%0A
-                .append(%22 Interval: %22)%0A                .append(getInterval())%0A                .append(%22 Time Interval: %22)%0A                .append(getTimeInterval())%0A
     

remove interval and time interval from getAsText method from ReadOnlyTask