@Test public void composed() { assertEquals("pref-bar-suff", new Substitutor(singletonMap("foo", "bar")).replace("pref-${foo}-suff")); }
public String replace(final String source) { if (source == null) { return null; } final StringBuilder builder = new StringBuilder(source); if (substitute(builder, 0, source.length(), null) <= 0) { return source; } return replace(builder.toString()); }
Substitutor { public String replace(final String source) { if (source == null) { return null; } final StringBuilder builder = new StringBuilder(source); if (substitute(builder, 0, source.length(), null) <= 0) { return source; } return replace(builder.toString()); } }
Substitutor { public String replace(final String source) { if (source == null) { return null; } final StringBuilder builder = new StringBuilder(source); if (substitute(builder, 0, source.length(), null) <= 0) { return source; } return replace(builder.toString()); } Substitutor(final Map<String, String> valueMap); }
Substitutor { public String replace(final String source) { if (source == null) { return null; } final StringBuilder builder = new StringBuilder(source); if (substitute(builder, 0, source.length(), null) <= 0) { return source; } return replace(builder.toString()); } Substitutor(final Map<String, String> valueMap); String replace(final String source); }
Substitutor { public String replace(final String source) { if (source == null) { return null; } final StringBuilder builder = new StringBuilder(source); if (substitute(builder, 0, source.length(), null) <= 0) { return source; } return replace(builder.toString()); } Substitutor(final Map<String, String> valueMap); String replace(final String source);  }