Example usage for org.apache.commons.lang3.text StrBuilder contains

List of usage examples for org.apache.commons.lang3.text StrBuilder contains

Introduction

In this page you can find the example usage for org.apache.commons.lang3.text StrBuilder contains.

Prototype

public boolean contains(final StrMatcher matcher) 

Source Link

Document

Checks if the string builder contains a string matched using the specified matcher.

Usage

From source file:org.selenium.runner.services.SeleniumRunner.java

protected String injectValue(final String instruction) throws SeleniumRunnerException {
    if (instruction == null) {
        throw new SeleniumRunnerException("can't inject value in null instruction !");
    }//  w w w. j av  a 2 s. c  o m

    StrBuilder result = new StrBuilder(instruction);

    String keyPattern = null;
    for (String key : storedValues.keySet()) {
        keyPattern = "${" + key + "}";
        if (result.contains(keyPattern)) {
            result.replaceAll(keyPattern, storedValues.get(key));
        }
    }

    return result.toString();

}