Search in sources :

Example 1 with Replacer

use of jregex.Replacer in project cloudbreak by hortonworks.

the class AccountTelemetryService method testRulePatterns.

public String testRulePatterns(List<AnonymizationRule> rules, String input) {
    String output = input;
    for (AnonymizationRule rule : rules) {
        String decodedRule = new String(Base64.getDecoder().decode(rule.getValue().getBytes()));
        Pattern p = createAndCheckPattern(decodedRule);
        Replacer replacer = p.replacer(rule.getReplacement());
        output = replacer.replace(output);
    }
    return output;
}
Also used : AnonymizationRule(com.sequenceiq.common.api.telemetry.model.AnonymizationRule) Pattern(jregex.Pattern) Replacer(jregex.Replacer)

Aggregations

AnonymizationRule (com.sequenceiq.common.api.telemetry.model.AnonymizationRule)1 Pattern (jregex.Pattern)1 Replacer (jregex.Replacer)1