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

com.github.mowedgrass.jasyptgradleboot.task.file.property.pattern.ProcessPatternMatcher.groovy Maven / Gradle / Ivy

The newest version!
package com.github.mowedgrass.jasyptgradleboot.task.file.property.pattern

class ProcessPatternMatcher {

    public Optional getMatches(String line, String pattern) {
        def matches = Optional.empty()
        line.find(pattern) {
            matches = Optional.of(extract(it as List))
        }

        matches
    }

    private ProcessPatternMatches extract(List matches) {
        def (String line, String preceding, String value, String succeeding) = matches

        new ProcessPatternMatches(preceding, value, succeeding)
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy