@Test(expected = LDFusionToolException.class) public void throwsWhenRequiredIntParamMissing() throws Exception { Map<String, String> params = newHashMap(); params.put("key2", "value2"); ParamReader paramReader = new ParamReader(params, "object"); paramReader.getRequiredIntValue("key1"); }
public Integer getRequiredIntValue(String paramName) throws LDFusionToolException { String value = getRequiredValue(paramName); try { return Integer.parseInt(value); } catch (NumberFormatException e) { throw new LDFusionToolException(getNumberFormatErrorMessage(paramName, value)); } }
ParamReader { public Integer getRequiredIntValue(String paramName) throws LDFusionToolException { String value = getRequiredValue(paramName); try { return Integer.parseInt(value); } catch (NumberFormatException e) { throw new LDFusionToolException(getNumberFormatErrorMessage(paramName, value)); } } }
ParamReader { public Integer getRequiredIntValue(String paramName) throws LDFusionToolException { String value = getRequiredValue(paramName); try { return Integer.parseInt(value); } catch (NumberFormatException e) { throw new LDFusionToolException(getNumberFormatErrorMessage(paramName, value)); } } ParamReader(Map<String, String> params, String parametrizedObjectLabel); }
ParamReader { public Integer getRequiredIntValue(String paramName) throws LDFusionToolException { String value = getRequiredValue(paramName); try { return Integer.parseInt(value); } catch (NumberFormatException e) { throw new LDFusionToolException(getNumberFormatErrorMessage(paramName, value)); } } ParamReader(Map<String, String> params, String parametrizedObjectLabel); String getLabel(); String getRequiredStringValue(String paramName); String getStringValue(String paramName); String getStringValue(String paramName, String defaultValue); Integer getRequiredIntValue(String paramName); Integer getIntValue(String paramName); int getIntValue(String paramName, int defaultValue); Long getRequiredLongValue(String paramName); Long getLongValue(String paramName); long getLongValue(String paramName, long defaultValue); }
ParamReader { public Integer getRequiredIntValue(String paramName) throws LDFusionToolException { String value = getRequiredValue(paramName); try { return Integer.parseInt(value); } catch (NumberFormatException e) { throw new LDFusionToolException(getNumberFormatErrorMessage(paramName, value)); } } ParamReader(Map<String, String> params, String parametrizedObjectLabel); String getLabel(); String getRequiredStringValue(String paramName); String getStringValue(String paramName); String getStringValue(String paramName, String defaultValue); Integer getRequiredIntValue(String paramName); Integer getIntValue(String paramName); int getIntValue(String paramName, int defaultValue); Long getRequiredLongValue(String paramName); Long getLongValue(String paramName); long getLongValue(String paramName, long defaultValue);  }