Class WildcardMatcher
- java.lang.Object
-
- com.floragunn.searchguard.support.WildcardMatcher
-
public class WildcardMatcher extends Object
-
-
Constructor Summary
Constructors Constructor Description WildcardMatcher()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanallPatternsMatched(String[] pattern, String[] candidate)static booleanallPatternsMatched(Collection<String> pattern, Collection<String> candidate)static booleancontainsWildcard(String pattern)static List<String>getAllMatchingPatterns(Collection<String> pattern, String candidate)static List<String>getAllMatchingPatterns(Collection<String> pattern, Collection<String> candidates)static Optional<String>getFirstMatchingPattern(Collection<String> pattern, String candidate)static List<String>getMatchAny(String[] patterns, String[] candidate)static List<String>getMatchAny(String[] patterns, Collection<String> candidate)static List<String>getMatchAny(String pattern, String[] candidate)static List<String>getMatchAny(String pattern, Collection<String> candidate)static List<String>getMatchAny(Collection<String> patterns, String[] candidate)static List<String>getMatchAny(Collection<String> patterns, Collection<String> candidates)static booleanmatch(String pattern, String candidate)static booleanmatch(String pattern, String candidate, boolean ignoreCase)static booleanmatchAll(String[] pattern, String[] candidate)return true if all candidates find a matching patternstatic booleanmatchAny(String[] pattern, String candidate)returns true if the candidate matches at least one patternstatic booleanmatchAny(String[] pattern, String[] candidate)returns true if at least one candidate match at least one pattern (case sensitive)static booleanmatchAny(String[] pattern, String[] candidate, boolean ignoreCase)returns true if at least one candidate match at least one patternstatic booleanmatchAny(String pattern, String[] candidate)static booleanmatchAny(String pattern, String[] candidate, boolean ignoreCase)return true if at least one candidate matches the given patternstatic booleanmatchAny(String pattern, Collection<String> candidate)static booleanmatchAny(String pattern, Collection<String> candidates, boolean ignoreCase)static booleanmatchAny(Collection<String> pattern, String candidate)returns true if the candidate matches at least one patternstatic booleanmatchAny(Collection<String> pattern, String[] candidate, boolean ignoreCase)returns true if at least one candidate match at least one patternstatic booleanmatchAny(Collection<String> pattern, Collection<String> candidate)static booleanmatchAny(Collection<String> pattern, Collection<String> candidate, boolean ignoreCase)static String[]matches(String pattern, String[] candidate, boolean ignoreCase)static booleanwildcardRemoveFromSet(Set<String> set, String stringContainingWc)static booleanwildcardRemoveFromSet(Set<String> set, Set<String> setContainingWc)static booleanwildcardRetainInSet(Set<String> set, String[] setContainingWc)
-
-
-
Method Detail
-
matchAny
public static boolean matchAny(String[] pattern, String[] candidate)
returns true if at least one candidate match at least one pattern (case sensitive)- Parameters:
pattern-candidate-- Returns:
-
matchAny
public static boolean matchAny(Collection<String> pattern, Collection<String> candidate)
-
matchAny
public static boolean matchAny(String[] pattern, String[] candidate, boolean ignoreCase)
returns true if at least one candidate match at least one pattern- Parameters:
pattern-candidate-ignoreCase-- Returns:
-
matchAny
public static boolean matchAny(Collection<String> pattern, String[] candidate, boolean ignoreCase)
returns true if at least one candidate match at least one pattern- Parameters:
pattern-candidate-ignoreCase-- Returns:
-
matchAny
public static boolean matchAny(Collection<String> pattern, Collection<String> candidate, boolean ignoreCase)
-
matchAll
public static boolean matchAll(String[] pattern, String[] candidate)
return true if all candidates find a matching pattern- Parameters:
pattern-candidate-- Returns:
-
allPatternsMatched
public static boolean allPatternsMatched(String[] pattern, String[] candidate)
- Parameters:
pattern-candidate-- Returns:
-
allPatternsMatched
public static boolean allPatternsMatched(Collection<String> pattern, Collection<String> candidate)
-
matchAny
public static boolean matchAny(String pattern, Collection<String> candidate)
-
matchAny
public static boolean matchAny(String pattern, String[] candidate, boolean ignoreCase)
return true if at least one candidate matches the given pattern- Parameters:
pattern-candidate-ignoreCase-- Returns:
-
matchAny
public static boolean matchAny(String pattern, Collection<String> candidates, boolean ignoreCase)
-
getMatchAny
public static List<String> getMatchAny(Collection<String> patterns, String[] candidate)
-
getMatchAny
public static List<String> getMatchAny(Collection<String> patterns, Collection<String> candidates)
-
getMatchAny
public static List<String> getMatchAny(String pattern, Collection<String> candidate)
-
getMatchAny
public static List<String> getMatchAny(String[] patterns, Collection<String> candidate)
-
getFirstMatchingPattern
public static Optional<String> getFirstMatchingPattern(Collection<String> pattern, String candidate)
-
getAllMatchingPatterns
public static List<String> getAllMatchingPatterns(Collection<String> pattern, String candidate)
-
getAllMatchingPatterns
public static List<String> getAllMatchingPatterns(Collection<String> pattern, Collection<String> candidates)
-
matchAny
public static boolean matchAny(String[] pattern, String candidate)
returns true if the candidate matches at least one pattern- Parameters:
pattern-candidate-- Returns:
-
matchAny
public static boolean matchAny(Collection<String> pattern, String candidate)
returns true if the candidate matches at least one pattern- Parameters:
pattern-candidate-- Returns:
-
containsWildcard
public static boolean containsWildcard(String pattern)
-
wildcardRemoveFromSet
public static boolean wildcardRemoveFromSet(Set<String> set, String stringContainingWc)
- Parameters:
set- will be modifiedstringContainingWc-- Returns:
-
wildcardRemoveFromSet
public static boolean wildcardRemoveFromSet(Set<String> set, Set<String> setContainingWc)
- Parameters:
set- will be modifiedstringContainingWc-- Returns:
-
-