public static class RegexRuleSet.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(RegexRuleSet.Response defaultResponse)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
RegexRuleSet.Builder |
addRule(java.util.regex.Pattern pattern,
RegexRuleSet.Response response)
Add a rule by with the given pre-compiled regular expression.
|
RegexRuleSet.Builder |
addRule(java.lang.String regexString,
RegexRuleSet.Response response)
Add a rule by compiling the given string into a regular expression.
|
RegexRuleSet |
build()
Build the ruleset.
|
public Builder(RegexRuleSet.Response defaultResponse)
defaultResponse
- the response to return if no rule is matchedpublic RegexRuleSet.Builder addRule(java.lang.String regexString, RegexRuleSet.Response response)
regexString
- a regex stringresponse
- the response this rule returns if matchedpublic RegexRuleSet.Builder addRule(java.util.regex.Pattern pattern, RegexRuleSet.Response response)
pattern
- a patternresponse
- the response this rule returns if matchedpublic RegexRuleSet build()