package be.digitalia.fosdem.model;

import android.text.TextUtils;

public enum Building {
	J, K, H, U, AW, Unknown;

	public static Building fromRoomName(String roomName) {
		if (!TextUtils.isEmpty(roomName)) {
			switch (Character.toUpperCase(roomName.charAt(0))) {
			case 'K':
				return K;
			case 'H':
				return H;
			case 'U':
				return U;
			}
			if (roomName.regionMatches(true, 0, "AW", 0, 1)) {
				return AW;
			}
			if ("Janson".equalsIgnoreCase(roomName)) {
				return J;
			}
			if ("Ferrer".equalsIgnoreCase(roomName)) {
				return H;
			}
			if ("Chavanne".equalsIgnoreCase(roomName) || "Lameere".equalsIgnoreCase(roomName) || "Guillissen".equalsIgnoreCase(roomName)) {
				return U;
			}
		}

		return Unknown;
	}
}

@@ -261,16 +261,46 @@
 (0))) %7B%0A
+%09%09%09%09case 'J':%0A%09%09%09%09%09return J;%0A%09
 %09%09%09case 
@@ -304,16 +304,17 @@
 se 'K':%0A
+%09
 %09%09%09%09retu
@@ -319,16 +319,17 @@
 turn K;%0A
+%09
 %09%09%09case 
@@ -333,24 +333,25 @@
 se 'H':%0A%09%09%09%09
+%09
 return H;%0A%09%09
@@ -348,16 +348,17 @@
 turn H;%0A
+%09
 %09%09%09case 
@@ -362,16 +362,17 @@
 se 'U':%0A
+%09
 %09%09%09%09retu
@@ -434,9 +434,9 @@
  0, 
-1
+2
 )) %7B

improve Building name selection