code: private SitePreference getSitePreferenceQueryParameter(HttpServletRequest request) {
  		String string = request.getParameter(SITE_PREFERENCE_PARAMETER);
  		try {
  			return string != null && string.length() > 0 ? SitePreference.valueOf(string.toUpperCase()) : null;
  		} catch (IllegalArgumentException e) {
  			return null;
  		}
  	}
docs: internal helpers