Class RegexFilter.Builder

All Implemented Interfaces:
Builder<RegexFilter>
Enclosing class:
RegexFilter

public static final class RegexFilter.Builder extends AbstractFilter.AbstractFilterBuilder<RegexFilter.Builder> implements Builder<RegexFilter>
A RegexFilter builder instance.
Since:
2.27.0
  • Method Details

    • setRegex

      public RegexFilter.Builder setRegex(String regex)
      Sets the regular-expression.
      Parameters:
      regex - the regular-expression
      Returns:
      this builder
    • setUseRawMsg

      public RegexFilter.Builder setUseRawMsg(boolean useRawMsg)
      Sets the use raw msg flag.
      Parameters:
      useRawMsg - true if the message format-patter/field will be used as match target; otherwise, false
      Returns:
      this builder
    • isValid

      public boolean isValid()
      Validates that the builder is properly configured to build.
      Specified by:
      isValid in interface Builder<RegexFilter>
      Returns:
      true if the builder configuration is valid; otherwise, false
    • build

      public RegexFilter build()
      Builds and returns a RegexFilter instance configured by this builder.
      Specified by:
      build in interface Builder<RegexFilter>
      Returns:
      the created RegexFilter or null if the builder is misconfigured