package io.ohalloran.urdining.data;

/**
 * Created by Ben on 1/31/2015.
 */
public enum DiningHall {
    DANFORTH, DOUGLASS;

    public String titleCase() {
        char[] raw = toString().toCharArray();
        for (int i = 1; i < raw.length; i++)
            raw[i] -= 'A';
        return new String(raw);
    }

    public int getIndex() {
        switch (this) {
            case DANFORTH:
                return 0;
            case DOUGLASS:
                return 1;
        }
        throw new IllegalStateException(this + " is not not defined in getIndex");
    }

    public static DiningHall getEnum(String s) {
        return DiningHall.valueOf(s.toUpperCase());
    }

}

@@ -164,14 +164,14 @@
     
-char%5B%5D
+String
  raw
@@ -187,266 +187,255 @@
 ng()
-.toCharArray();%0A        for (int i = 1; i %3C raw.length; i++)%0A            raw%5Bi%5D -= 'A';%0A        return new String(raw);%0A    %7D%0A%0A    public int getIndex() %7B%0A        switch (this) %7B%0A            case DANFORTH:%0A                return 0;%0A            case DOUGLASS:
+;%0A        String tail = raw.substring(1).toLowerCase();%0A        return raw.charAt(0) + tail;%0A    %7D%0A%0A    public int getIndex() %7B%0A        DiningHall%5B%5D halls = values();%0A        for (int i = 0; i %3C halls.length; i++)%0A            if (this == halls%5Bi%5D)
 %0A   
@@ -454,17 +454,17 @@
  return 
-1
+i
 ;%0A      
@@ -469,92 +469,42 @@
     
-%7D%0A        throw new IllegalStateException(this + %22 is not not defined in getIndex%22);
+return -1; //will never reach here
 %0A   

Fix title case bug