package seedu.address.model.task;

import seedu.address.model.tag.Tag;
import seedu.address.model.tag.UniqueTagList;

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

    Name getName();
    Date getDate();
    Time getTime();
    Tag getTag();
    Description getDescription();
    Venue getVenue();
    Priority getPriority();
    boolean isFavorite();

    /**
     * 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.getDate().equals(this.getDate())
                && other.getTime().equals(this.getTime())
                && other.getTag().equals(this.getTag())
                && other.getDescription().equals(this.getDescription())
                && other.getVenue().equals(this.getVenue())
                && other.getPriority().equals(this.getPriority())
                && other.isFavorite()==this.isFavorite());
    }

    /**
     * Formats the person as text, showing all contact details.
     */
    default String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getName());
        if (getDate()!=null){
            builder.append("  Due Date:");
            builder.append(getDate());
        }
        return builder.toString();
    }

}

@@ -920,145 +920,290 @@
 te()
-.equals(this.getDate())%0A                && other.getTime().equals(this.getTime())%0A                && other.getTag().equals(this.getTag())
+ != null? other.getDate().equals(this.getDate()): this.getDate() == null%0A                && other.getTime() != null? other.getTime().equals(this.getTime()): this.getTime() == null%0A                && other.getTag() != null? other.getTag().equals(this.getTag()): this.getTag() == null
 %0A   
@@ -1240,16 +1240,31 @@
 iption()
+ != null? other
 .equals(
@@ -1285,16 +1285,47 @@
 ption())
+: this.getDescription() == null
 %0A       
@@ -1356,98 +1356,206 @@
 ue()
-.equals(this.getVenue())%0A                && other.getPriority().equals(this.getPriority())
+ != null? other.getVenue().equals(this.getVenue()): this.getVenue() == null%0A                && other.getPriority() != null? other.getPriority().equals(this.getPriority()): this.getPriority() == null
 %0A   

Modify equals method in ReadOnlyTask