List of utility methods to do String Substritute
void | substituteToken(StringBuffer buf, String token, String value) substitute Token String from = getTokenString(token); int fromLength = from.length(); for (int index = buf.indexOf(from); index != -1; index = buf.indexOf(from, index)) { buf.replace(index, index + fromLength, value); |
String | substituteUserId(final long aUserId, final String aTemplate) substitute User Id return aTemplate.replace("@{userId}", Long.toString(aUserId)); |
String | substituteVars(String text, char[] names, Object[] values) Equivalent to #substituteVars(String,char[],Object[],String[],String,boolean) substituteVars(text, names, values, null, null, false) . return substituteVars(text, names, values, null, null, false);
|
String | substituteWhenEmpty(Object value, String valueWhenEmpty) Similar to #nvl(Object,String) but returns valueWhenEmpty not only if value is null, but as well when the String representation of value is empty or contains only whitespaces.
String stringValue = nvl(value, null);
return hasText(stringValue) ? stringValue : valueWhenEmpty;
|