org.apache.sling.discovery.impl.common
Class WildcardHelper
java.lang.Object
org.apache.sling.discovery.impl.common.WildcardHelper
public class WildcardHelper
- extends Object
Helper class for wildcards
Method Summary |
static boolean |
matchesWildcard(String comparee,
String patternWithWildcards)
Compare a given string (comparee) against a pattern that contains wildcards
and return true if it matches. |
static String |
wildcardAsRegex(String patternWithWildcards)
converts a string containing wildcards (* and ?) into a valid regex |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WildcardHelper
public WildcardHelper()
wildcardAsRegex
public static String wildcardAsRegex(String patternWithWildcards)
- converts a string containing wildcards (* and ?) into a valid regex
matchesWildcard
public static boolean matchesWildcard(String comparee,
String patternWithWildcards)
- Compare a given string (comparee) against a pattern that contains wildcards
and return true if it matches.
- Parameters:
comparee
- the string which should be tested against a pattern containing wildcardspatternWithWildcards
- the pattern containing wildcards (* and ?)
- Returns:
- true if the comparee string matches against the pattern containing wildcards
Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.