public String replace(final Object target, final String before, final String after) { if (target == null) { return null; } return StringUtils.replace(target, before, after); }
private static URI toURI(final URL url) throws URISyntaxException { String location = url.toString(); if (location.indexOf(' ') == -1) { // No need to replace anything return new URI(location); } return new URI(StringUtils.replace(location, " ", "%20")); }
String unixPath = StringUtils.replace(path, "\\", "/");
final String originClassName = originClass.getName(); final String resourceBaseName = StringUtils.replace(originClassName, ".", "/");
public String multipleReplace(final Object target, final String[] before, final String[] after) { Validate.notNull(before, "Array of 'before' values cannot be null"); Validate.notNull(after, "Array of 'after' values cannot be null"); Validate.isTrue(before.length == after.length, "Arrays of 'before' and 'after' values must have the same length"); if (target == null) { return null; } String ret = target.toString(); for (int i = 0; i < before.length; i++) { ret = StringUtils.replace(ret, before[i], after[i]); } return ret; }
public String replace(final Object target, final String before, final String after) { return StringUtils.replace(target, before, after); }
@Override public String toParamString() { String queryStr = GlobalObjectMapper.writeValueAsString(this); LOGGER.debug("Aggregation Extension : " + queryStr); queryStr = StringUtils.replace(queryStr, ",", "\\,"); return "druid:" + queryStr; } }
public String multipleReplace(final Object target, final String[] before, final String[] after) { Validate.notNull(target, "Target cannot be null"); Validate.notNull(before, "Array of 'before' values cannot be null"); Validate.notNull(after, "Array of 'after' values cannot be null"); Validate.isTrue(before.length == after.length, "Arrays of 'before' and 'after' values must have the same length"); String ret = target.toString(); for (int i = 0; i < before.length; i++) { ret = StringUtils.replace(ret, before[i], after[i]); } return ret; }