aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/searchdefinition/parser/Utils.java
blob: d8f02b2a9c3acdb3a4ff337d64cd5ef2461084ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition.parser;

/**
 * @author bjorncs
 */
class Utils {

    private Utils() {}

    // Separate class since javacc does not accept Java code using lambdas
    static int count(String str, char ch) {
        return (int) str.chars().filter(c -> c == ch).count();
    }
}