/** * Creates a new instance and initializes it. * * @param <V> the type of the values in the map * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @param escape the escape character * @param valueDelimiter the variable default value delimiter, may be null * @throws IllegalArgumentException if the prefix or suffix is null * @since 3.2 */ public <V> StrSubstitutor( final Map<String, V> valueMap, final String prefix, final String suffix, final char escape, final String valueDelimiter) { this(StrLookup.mapLookup(valueMap), prefix, suffix, escape, valueDelimiter); }
/** * Creates a new instance and initializes it. Uses a default escaping character. * * @param <V> the type of the values in the map * @param valueMap the map with the variables' values, may be null * @param prefix the prefix for variables, not null * @param suffix the suffix for variables, not null * @throws IllegalArgumentException if the prefix or suffix is null */ public <V> StrSubstitutor( final Map<String, V> valueMap, final String prefix, final String suffix) { this(StrLookup.mapLookup(valueMap), prefix, suffix, DEFAULT_ESCAPE); }
/** * Creates a new instance and initializes it. Uses defaults for variable prefix and suffix and the * escaping character. * * @param <V> the type of the values in the map * @param valueMap the map with the variables' values, may be null */ public <V> StrSubstitutor(final Map<String, V> valueMap) { this(StrLookup.mapLookup(valueMap), DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_ESCAPE); }