@Test public void convertToWithNull() throws Exception { expectedException.expect(ParameterException.class); expectedException.expectMessage("Couldn't convert \"null\" to string."); new StringMapConverter().convertTo(null); }
@Override public String convertTo(Map<String, String> value) { if (value == null) { throw new ParameterException("Couldn't convert \"null\" to string."); } return Joiner.on(SEPARATOR) .withKeyValueSeparator(KEY_VALUE_SEPARATOR) .useForNull("") .join(value); }
StringMapConverter implements Converter<Map<String, String>> { @Override public String convertTo(Map<String, String> value) { if (value == null) { throw new ParameterException("Couldn't convert \"null\" to string."); } return Joiner.on(SEPARATOR) .withKeyValueSeparator(KEY_VALUE_SEPARATOR) .useForNull("") .join(value); } }
StringMapConverter implements Converter<Map<String, String>> { @Override public String convertTo(Map<String, String> value) { if (value == null) { throw new ParameterException("Couldn't convert \"null\" to string."); } return Joiner.on(SEPARATOR) .withKeyValueSeparator(KEY_VALUE_SEPARATOR) .useForNull("") .join(value); }  }
StringMapConverter implements Converter<Map<String, String>> { @Override public String convertTo(Map<String, String> value) { if (value == null) { throw new ParameterException("Couldn't convert \"null\" to string."); } return Joiner.on(SEPARATOR) .withKeyValueSeparator(KEY_VALUE_SEPARATOR) .useForNull("") .join(value); }  @Override Map<String, String> convertFrom(String value); @Override String convertTo(Map<String, String> value); }
StringMapConverter implements Converter<Map<String, String>> { @Override public String convertTo(Map<String, String> value) { if (value == null) { throw new ParameterException("Couldn't convert \"null\" to string."); } return Joiner.on(SEPARATOR) .withKeyValueSeparator(KEY_VALUE_SEPARATOR) .useForNull("") .join(value); }  @Override Map<String, String> convertFrom(String value); @Override String convertTo(Map<String, String> value);  }