package org.commcare.dalvik.activities;

/**
 * Enum representing the different logical/UI states that you can be in while on the login screen
 *
 * @author Aliza Stone (astone@dimagi.com)
 */
public enum LoginMode {

    PASSWORD("password-mode"),
    PIN("pin-mode"),
    PRIMED("primed-mode");

    private String stringVersion;

    LoginMode(String s) {
        this.stringVersion = s;
    }

    @Override
    public String toString() {
        return this.stringVersion;
    }

    public static LoginMode fromString(String s) {
        switch(s) {
            case "password-mode":
                return PASSWORD;
            case "pin-mode":
                return PIN;
            case "primed-mode":
                return PRIMED;
            default:
                return null;
        }
    }
}
@@ -227,494 +227,270 @@
 WORD
-(%22password-mode%22),%0A    PIN(%22pin-mode%22),%0A    PRIMED(%22primed-mode%22);%0A%0A    private String stringVersion;%0A%0A    LoginMode(String s) %7B%0A        this.stringVersion = s;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return this.stringVersion;%0A    %7D%0A%0A    public static LoginMode fromString(String s) %7B%0A        switch(s) %7B%0A            case %22password-mode%22:%0A                return PASSWORD;%0A            case %22pin-mode%22:%0A                return PIN;%0A            case %22primed-mode%22:%0A    
+, PIN, PRIMED;%0A%0A    public static LoginMode fromString(String s) %7B%0A        if (PASSWORD.toString().equals(s)) %7B%0A            return PASSWORD;%0A        %7D else if (PIN.toString().equals(s)) %7B%0A            return PIN;%0A        %7D else if (PRIMED.toString().equals(s)) %7B%0A
     
@@ -524,25 +524,17 @@
     
-    default:%0A    
+%7D else %7B%0A
     

simplify LoginMode enum