package seedu.jimi.model.tag;

import seedu.jimi.commons.exceptions.IllegalValueException;

/*
 * Represents the priority of the tasks & events in Jimi.
 * 
 * Priorities can be classified into: LOW, MED & HIGH
 */

public class Priority extends Tag{
    
    public static final String MESSAGE_PRIORITY_CONSTRAINTS = "Priority names should only be: LOW, MED or HIGH. ";

    public final static String priorityLow = "LOW";
    public final static String priorityMed = "MED";
    public final static String priorityHigh = "HIGH";
            
    public Priority()   {
        tagName = "med"; 
    }
    
    /**
     * Validates given priority name.
     *
     * @throws IllegalValueException if the given tag name string is invalid.
     */
    public Priority(String name) throws IllegalValueException {
        assert name != null;
        name = name.trim();
        if (!isValidPriorityName(name)) {
            throw new IllegalValueException(MESSAGE_TAG_CONSTRAINTS);
        }
        this.tagName = name;
    }
    
    /**
     * Returns true if a given string is a valid priority name.
     */
    public static boolean isValidPriorityName(String test) {
        if (test == priorityLow || test == priorityMed || test == priorityHigh)    {
            return true;
        }
        else 
            return false;
    }
    
}

@@ -585,11 +585,11 @@
  = %22
-med
+MED
 %22; %0A
@@ -957,11 +957,16 @@
 AGE_
-TAG
+PRIORITY
 _CON
@@ -1179,28 +1179,32 @@
     if (test
- == 
+.equals(
 priorityLow 
@@ -1202,24 +1202,25 @@
 orityLow
+)
  %7C%7C test
  == prio
@@ -1203,36 +1203,40 @@
 rityLow) %7C%7C test
- == 
+.equals(
 priorityMed %7C%7C t
@@ -1230,24 +1230,25 @@
 orityMed
+)
  %7C%7C test
  == prio
@@ -1243,12 +1243,16 @@
 test
- == 
+.equals(
 prio
@@ -1260,16 +1260,17 @@
 ityHigh)
+)
     %7B%0A  

Edit Priority