@Test public void returnsStringValueWhenStringParamPresentAndDefaultGiven() throws Exception { Map<String, String> params = newHashMap(); params.put("key1", "value1"); params.put("key2", "value2"); ParamReader paramReader = new ParamReader(params, "object"); String result = paramReader.getStringValue("key1", "default"); assertThat(result, equalTo("value1")); }
public String getStringValue(String paramName) { return params.get(paramName); }
ParamReader { public String getStringValue(String paramName) { return params.get(paramName); } }
ParamReader { public String getStringValue(String paramName) { return params.get(paramName); } ParamReader(Map<String, String> params, String parametrizedObjectLabel); }
ParamReader { public String getStringValue(String paramName) { return params.get(paramName); } 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 String getStringValue(String paramName) { return params.get(paramName); } 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);  }