{
if (val != null)
{
float rtn = Float.valueOf(val);
if (rtn > 1.0F)
throw new RestFailure("Accept-Language q value cannot be greater than 1.0 " + lang.toString(), HttpResponseCodes.SC_BAD_REQUEST);
return rtn;
}
}
catch (NumberFormatException e)
{
throw new RestFailure("MediaType q parameter must be a float: " + lang, HttpResponseCodes.SC_BAD_REQUEST);
}
return 1.0f;
}