All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cucumber.core.snippets.SnakeCaseJoiner Maven / Gradle / Ivy

The newest version!
package io.cucumber.core.snippets;

import java.util.List;

class SnakeCaseJoiner implements Joiner {

    @Override
    public String concatenate(List words) {
        StringBuilder functionName = new StringBuilder();
        boolean firstWord = true;
        for (String word : words) {
            if (firstWord) {
                firstWord = false;
            } else {
                functionName.append('_');
            }
            functionName.append(word.toLowerCase());
        }
        return functionName.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy