code: public static <T extends Enum<T>> T enumSwitch(String switchValue, T defaultValue) {
  		try {
  			return Enum.valueOf(defaultValue.getDeclaringClass(), switchValue);
  		} catch (Exception e) {
  			return defaultValue;
  		}
  	}
docs: /* enums