package seedu.address.model.task;


import seedu.address.commons.exceptions.IllegalValueException;

/**
 * Represents a task's due time in the task manager.
 * Guarantees: immutable; is valid as declared in {@link #isValidTime(String)}
 */
public class Time implements Field {

    public static final String MESSAGE_TIME_CONSTRAINTS =
            "Task time should be the form hh/mm";

    /*
     * The first character of the time must not be a whitespace,
     * otherwise " " (a blank string) becomes a valid input.
     */
    // TODO: public static final String ADDRESS_VALIDATION_REGEX = "[^\\s].*";

    public final String value;

    /**
     * Validates given time.
     *
     * @throws IllegalValueException if given time string is invalid.
     */
    public Time(String time) throws IllegalValueException {
        assert time != null;
        if (!isValidTime(time)) {
            throw new IllegalValueException(MESSAGE_TIME_CONSTRAINTS);
        }
        this.value = time;
    }

    /**
     * Returns true if a given string is a valid person email.
     */
    public static boolean isValidTime(String test) {
        return true;
        //TODO:return test.matches(ADDRESS_VALIDATION_REGEX);
    }

    @Override
    public String toString() {
        return value;
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof Time // instanceof handles nulls
                && this.value.equals(((Time) other).value)); // state check
    }

    @Override
    public int hashCode() {
        return value.hashCode();
    }

	@Override
	public String getDisplayText() {
		if ((value == null) || (value == "")) {
			return "";
		} else {
			return "Time: " + value;
		}
	}
}

@@ -28,17 +28,16 @@
 .task;%0A%0A
-%0A
 import s
@@ -372,17 +372,17 @@
  form hh
-/
+:
 mm%22;%0A%0A  
@@ -528,80 +528,283 @@
     
-// TODO: public static final String ADDRESS_VALIDATION_REGEX = %22%5B%5E%5C%5Cs%5D.*
+public static final String HOUR_VALIDATION_REGEX = %22(%5C%5Cd)%7C(0%5C%5Cd)%7C(1%5C%5Cd)%7C(2%5B0-3%5D)%22;%0A    public static final String MINUTE_VALIDATION_REGEX = %22%5B0-5%5D%5B0-9%5D%22;%0A    public static final String TIME_VALIDATION_REGEX = %22.*:.*%22;%0A    public static final String HOUR_MINUTE_SEPARATOR = %22:
 %22;%0A%0A
@@ -1339,63 +1339,573 @@
     
-return true;%0A        //TODO:return test.matches(ADDRESS
+if (test.equals(%22%22)) %7B%0A            return true;%0A        %7D%0A        if (!test.matches(TIME_VALIDATION_REGEX)) %7B%0A            return false;%0A        %7D%0A        String%5B%5D hourAndMinute = test.split(HOUR_MINUTE_SEPARATOR);%0A        String hour = hourAndMinute%5B0%5D;%0A        String minute = hourAndMinute%5B1%5D;%0A        return isValidHour(hour) && isValidMinute(minute);%0A    %7D%0A%0A    private static boolean isValidHour(String test) %7B%0A        return test.matches(HOUR_VALIDATION_REGEX);%0A    %7D%0A%0A    private static boolean isValidMinute(String test) %7B%0A        return test.matches(MINUTE
 _VAL

Add regex for time