Class RegexRuleSet.Builder
java.lang.Object
com.netflix.genie.common.internal.util.RegexRuleSet.Builder
- Enclosing class:
- RegexRuleSet
Ruleset builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddRule
(String regexString, RegexRuleSet.Response response) Add a rule by compiling the given string into a regular expression.addRule
(Pattern pattern, RegexRuleSet.Response response) Add a rule by with the given pre-compiled regular expression.build()
Build the ruleset.
-
Constructor Details
-
Builder
Constructor.- Parameters:
defaultResponse
- the response to return if no rule is matched
-
-
Method Details
-
addRule
Add a rule by compiling the given string into a regular expression.- Parameters:
regexString
- a regex stringresponse
- the response this rule returns if matched- Returns:
- the builder
-
addRule
Add a rule by with the given pre-compiled regular expression.- Parameters:
pattern
- a patternresponse
- the response this rule returns if matched- Returns:
- the builder
-
build
Build the ruleset.- Returns:
- a RegexRuleSet
-