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

com.jessecoyle.WildcardHelper Maven / Gradle / Ivy

The newest version!
package com.jessecoyle;

import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Stream;

class WildcardHelper {

    static Stream credentialNamesMatchingWildcard(List credentialVersions, String credential) {
        Pattern pattern = Pattern.compile('^' + credential.replace("*", ".*") + '$');
        return credentialVersions.stream()
                .map(CredentialVersion::getName)
                .distinct()
                .filter(name -> pattern.matcher(name).matches());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy