Package org.apache.sling.discovery.base.connectors.ping.wl

# Class WildcardHelper

java.lang.Object
org.apache.sling.discovery.base.connectors.ping.wl.WildcardHelper

public class WildcardHelper extends Object
Helper class for wildcards

## Constructor Summary

Constructors
Constructor
Description
`WildcardHelper()`

## Method Summary

Modifier and Type
Method
Description
`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`

## Constructor Details

### WildcardHelper

public WildcardHelper()

## Method Details

### 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 wildcards
  `patternWithWildcards` - the pattern containing wildcards (* and ?)
Returns:
  true if the comparee string matches against the pattern containing wildcards