MCPcopy
hub / github.com/OpenTSDB/opentsdb / clean

Method clean

src/query/expression/ExpressionTree.java:219–236  ·  view source on GitHub ↗

Helper to clean out some characters @param values The collection of strings to cleanup @return An empty string if values was empty or a cleaned up string

(final Collection<String> values)

Source from the content-addressed store, hash-verified

217 * @return An empty string if values was empty or a cleaned up string
218 */
219 private String clean(final Collection<String> values) {
220 if (values == null || values.size() == 0) {
221 return "";
222 }
223
224 final List<String> strs = Lists.newArrayList();
225 for (String v : values) {
226 final String tmp = v.replaceAll("\\{.*\\}", "");
227 final int ix = tmp.lastIndexOf(':');
228 if (ix < 0) {
229 strs.add(tmp);
230 } else {
231 strs.add(tmp.substring(ix+1));
232 }
233 }
234
235 return DOUBLE_COMMA_JOINER.join(strs);
236 }
237
238 @VisibleForTesting
239 List<ExpressionTree> subExpressions() {

Callers 1

writeStringFieldMethod · 0.95

Calls 2

sizeMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected