package seedu.address.model.task;


import seedu.address.commons.exceptions.IllegalValueException;

/**
 * Represents a Task's priority in the task manager.
 * Guarantees: immutable; is valid as declared in {@link #isValidPriority(String)}
 */
public class Priority {
    
    public static final String MESSAGE_PRIORITY_CONSTRAINTS = "Task priority should /low, /medium or /high";
//    public static final String PRIORITY_VALIDATION_REGEX = "(high|medium|low)";

    public final String value;

    /**
     * Creates a default priority object, which has value "low"
     * 
     * @author A0139661Y
     */
    public Priority() {
    	value = "low";
    }
    
    /**
     * Validates given priority.
     *
     * @throws IllegalValueException if given address string is invalid.
     */
    public Priority(String priority) throws IllegalValueException {
        assert priority != null;
        if (!isValidPriority(priority)) {
            throw new IllegalValueException(MESSAGE_PRIORITY_CONSTRAINTS);
        }
        this.value = priority.toLowerCase();
    }

    /**
     * Returns true if a given string is a valid priority.
     * 
     * @author A0139661Y
     */
    public static boolean isValidPriority(String testString) {
//        return test.matches(PRIORITY_VALIDATION_REGEX);
    	String test = testString.toLowerCase();
    	if (test.equals("high") || test.equals(("medium")) || test.equals("low") || test.equals(""))
    		return true;
    	return false;
    }

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

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

}
@@ -456,16 +456,203 @@
 m%7Clow)%22;
+%0A    %0A    public static final String HIGH = %22high%22;%0A    public static final String MEDIUM = %22medium%22;%0A    public static final String LOW = %22low%22;%0A    public static final String NONE = %22%22;
 %0A%0A    pu
@@ -827,21 +827,19 @@
 value = 
-%22low%22
+LOW
 ;%0A    %7D%0A
@@ -1547,22 +1547,20 @@
 .equals(
-%22high%22
+HIGH
 ) %7C%7C tes
@@ -1569,24 +1569,22 @@
 equals((
-%22medium%22
+MEDIUM
 )) %7C%7C te
@@ -1593,21 +1593,19 @@
 .equals(
-%22low%22
+LOW
 ) %7C%7C tes
@@ -1613,18 +1613,20 @@
 .equals(
-%22%22
+NONE
 ))%0A    %09

We'll make some constants in Priority: H,M,L