<commit_before>package seedu.doist.model.task;

import java.util.Comparator;
import java.util.Date;
import java.util.List;

import seedu.doist.model.tag.UniqueTagList;
import seedu.doist.model.task.Priority.PriorityLevel;

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

    Description getDescription();
    Priority getPriority();
    FinishedStatus getFinishedStatus();
    Date getStartDate();
    Date getEndDate();
    /**
     * 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(ReadOnlyTask other) {
        return other == this // short circuit if same object
                || (other != null // this is first to avoid NPE below
                && other.getDescription().equals(this.getDescription())
                && other.getFinishedStatus().equals(this.getFinishedStatus())); // state checks here onwards
    }

    /**
     * Formats the task as text, showing description and tags
     */
    default String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getDescription());
        getTags().forEach(builder::append);
        return builder.toString();
    }

    /**
     * Compare the priority of two tasks<commit_msg>when compare whether 2 task are equal, compare all the property TODO: let the tag list be empty by default and add for checking tag list also issue resolved #76<commit_after>package seedu.doist.model.task;

import java.util.Comparator;
import java.util.Date;
import java.util.List;

import seedu.doist.model.tag.UniqueTagList;
import seedu.doist.model.task.Priority.PriorityLevel;

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

    Description getDescription();
    Priority getPriority();
    FinishedStatus getFinishedStatus();
    Date getStartDate();
    Date getEndDate();
    /**
     * 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(ReadOnlyTask other) {
        return other == this  // short circuit if same object
                || (other != null  // this is first to avoid NPE below
                && other.getDescription().equals(this.getDescription())  // state checks here onwards
                && other.getFinishedStatus().equals(this.getFinishedStatus())
                && other.getPriority().equals(this.getPriority())
                && ((other.getStartDate() == null && this.getStartDate() == null)
                        || (this.getStartDate() != null && other.getStartDate() != null
                            && other.getStartDate().equals(this.getStartDate())))
                && ((other.getEndDate() == null && this.getEndDate() == null)
                        || (this.getEndDate() != null && other.getEndDate() != null
                            && other.getEndDate().equals(this.getEndDate()))));
    }

    /**
     * Formats the task as text, showing description and tags
     */
    default String getAsText() {
        final StringBuilder builder = new StringBuilder();
        builder.append(getDescription());
        getTags().forEach(builder::append);
        return builder.toString();
    }

    /**
     * Compare the priority of two tasks
{'fraction_non_alphanumeric': 0.10657827638959715, 'fraction_numerical': 0.0007649158592554819, 'mean_word_length': 2.68703007518797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4736228', 'n_tokens_mistral': 1012, 'n_tokens_neox': 984, 'n_words': 329}