private static float getQWithParamInfo(WeightedLanguage lang, String val) { try { if (val != null) { float rtn = Float.valueOf(val); if (rtn > 1.0F) throw new LoggableFailure(Messages.MESSAGES.qValueCannotBeGreaterThan1(lang.toString()), HttpResponseCodes.SC_BAD_REQUEST); return rtn; } } catch (NumberFormatException e) { throw new LoggableFailure(Messages.MESSAGES.mediaTypeQWeightedLanguageMustBeFloat(lang.toString()), HttpResponseCodes.SC_BAD_REQUEST); } return 1.0f; }
private static float getQWithParamInfo(WeightedLanguage lang, String val) { try { if (val != null) { float rtn = Float.valueOf(val); if (rtn > 1.0F) throw new LoggableFailure(Messages.MESSAGES.qValueCannotBeGreaterThan1(lang.toString()), HttpResponseCodes.SC_BAD_REQUEST); return rtn; } } catch (NumberFormatException e) { throw new LoggableFailure(Messages.MESSAGES.mediaTypeQWeightedLanguageMustBeFloat(lang.toString()), HttpResponseCodes.SC_BAD_REQUEST); } return 1.0f; }
private static float getQWithParamInfo(WeightedLanguage lang, String val) { try { if (val != null) { float rtn = Float.valueOf(val); if (rtn > 1.0F) throw new LoggableFailure(Messages.MESSAGES.qValueCannotBeGreaterThan1(lang.toString()), HttpResponseCodes.SC_BAD_REQUEST); return rtn; } } catch (NumberFormatException e) { throw new LoggableFailure(Messages.MESSAGES.mediaTypeQWeightedLanguageMustBeFloat(lang), HttpResponseCodes.SC_BAD_REQUEST); } return 1.0f; }