@@ -0,0 +1,2539 @@
+package seedu.taskitty.model.task;%0A%0Aimport java.time.DateTimeException;%0Aimport java.time.LocalTime;%0Aimport java.time.format.DateTimeFormatter;%0A%0Aimport seedu.taskitty.commons.exceptions.IllegalValueException;%0Aimport seedu.taskitty.commons.util.TimeUtil;%0A%0A/**%0A * Represents a Task's name in the task manager.%0A * Guarantees: immutable; is valid as declared in %7B@link #isValidName(String)%7D%0A */%0Apublic class TaskTime %7B%0A%0A    //TODO add more ways to type the time. eg. am/pm%0A    public static final String MESSAGE_TIME_CONSTRAINTS =%0A            %22Task times should be in the format hh:mm or hhmm%22;%0A    public static final String MESSAGE_TIME_INVALID =%0A            %22Task time provided is invalid!%22;%0A    public static final String TIME_DISPLAY_FORMAT = %22hh:mm%22;%0A    %0A    //format: hh:mm%0A    private static final String TIME_VALIDATION_REGEX_FORMAT_1 = %22%5B%5C%5Cp%7BDigit%7D%5D%7B1,2%7D:%5B%5C%5Cp%7BDigit%7D%5D%7B2%7D%22;%0A    //format: hhmm%0A    private static final String TIME_VALIDATION_REGEX_FORMAT_2 = %22%5B%5C%5Cp%7BDigit%7D%5D%7B4%7D%22;%0A    public static final String%5B%5D TIME_VALIDATION_REGEXES = %7B%0A            TIME_VALIDATION_REGEX_FORMAT_1,%0A            TIME_VALIDATION_REGEX_FORMAT_2, %7D;%0A%0A    public final LocalTime time;%0A%0A    /**%0A     * Validates given name.%0A     *%0A     * @throws IllegalValueException if given name string is invalid.%0A     */%0A    public TaskTime(String time) throws IllegalValueException %7B%0A        assert time != null;%0A        time = time.trim();%0A        if (!isValidName(time)) %7B%0A            throw new IllegalValueException(MESSAGE_TIME_CONSTRAINTS);%0A        %7D%0A        %0A        try %7B%0A            this.time = TimeUtil.parseTime(time);%0A        %7D catch (DateTimeException dateTimeException) %7B%0A            throw new IllegalValueException(MESSAGE_TIME_INVALID);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Returns true if a given string is a valid person name.%0A     */%0A    public static boolean isValidName(String test) %7B%0A        for (String format : TIME_VALIDATION_REGEXES) %7B%0A            if (test.matches(format)) %7B%0A                return true;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%0A%0A    @Override%0A    public String toString() %7B%0A        return time.format(DateTimeFormatter.ofPattern(TIME_DISPLAY_FORMAT));%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object other) %7B%0A        return other == this // short circuit if same object%0A                %7C%7C (other instanceof TaskTime // instanceof handles nulls%0A                && this.time.equals(((TaskTime) other).time)); // state check%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return time.hashCode();%0A    %7D%0A%0A%7D%0A

Add TaskTime