package seedu.taskmanager.model.item;

import seedu.taskmanager.model.tag.UniqueTagList;

/**
 * A read-only immutable interface for a Item in the task manager.
 * Implementations should guarantee: details are present and not null, field values are validated.
 * Date and Time can be empty strings.
 */
public interface ReadOnlyItem {

    ItemType getItemType();
    Name getName();
    Date getStartDate();
    Time getStartTime();
    Date getEndDate();
    Time getEndTime();

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

    /**
     * Returns true if both have the same state. (interfaces cannot override .equals)
     */
    default boolean isSameStateAs(ReadOnlyItem other) {
        return other == this // short circuit if same object
                || (other != null // this is first to avoid NPE below
                && other.getItemType().equals(this.getItemType()) // state checks here onwards
                && other.getName().equals(this.getName())
                && other.getEndDate().equals(this.getEndDate())
                && other.getEndTime().equals(this.getEndTime()));
    }

    /**
     * Formats the person as text, showing all contact details.
     */
    default String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getItemType())
                .append(" Name: ")
                .append(getName());
        if (getItemType().toString().equals(ItemType.EVENT_WORD)) {
            builder.append(" Start Date: ")
                   .append(getStartDate())
                   .append(" Start time: ")
                   .append(getStartTime());
        }
        if (getItemType().toString().equals(ItemType.DEADLINE_WORD) || getItemType().toString().equals(ItemType.EVENT_WORD)) {
            builder.append(" End Date: ")
                   .append(getEndDate())
                   .append(" End time: ")
                   .append(getEndTime());
        }
        builder.append(" Tags: ");
        getTags().forEach(builder::append);
        return builder.toString();
    }

    /**
     * Returns a string representation of this Item'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());
        }
    }

}

@@ -1106,24 +1106,160 @@
 .getName())%0A
+                && other.getStartDate().equals(this.getStartDate())%0A                && other.getStartTime().equals(this.getStartTime())%0A
             

Update ReadOnlyItem duplicate check