Class RegexRuleSet.Builder

java.lang.Object
com.netflix.genie.common.internal.util.RegexRuleSet.Builder
Enclosing class:
RegexRuleSet

public static class RegexRuleSet.Builder extends Object
Ruleset builder.
  • Constructor Details

    • Builder

      public Builder(RegexRuleSet.Response defaultResponse)
      Constructor.
      Parameters:
      defaultResponse - the response to return if no rule is matched
  • Method Details

    • addRule

      public RegexRuleSet.Builder addRule(String regexString, RegexRuleSet.Response response)
      Add a rule by compiling the given string into a regular expression.
      Parameters:
      regexString - a regex string
      response - the response this rule returns if matched
      Returns:
      the builder
    • addRule

      public RegexRuleSet.Builder addRule(Pattern pattern, RegexRuleSet.Response response)
      Add a rule by with the given pre-compiled regular expression.
      Parameters:
      pattern - a pattern
      response - the response this rule returns if matched
      Returns:
      the builder
    • build

      public RegexRuleSet build()
      Build the ruleset.
      Returns:
      a RegexRuleSet