Class RegexScrubber.RegexScrubberBuilder

java.lang.Object
org.approvej.scrub.RegexScrubber.RegexScrubberBuilder
Enclosing class:
RegexScrubber

public static class RegexScrubber.RegexScrubberBuilder extends Object
Builder for creating a RegexScrubber.
  • Method Details

    • with

      public RegexScrubber with(Function<Integer,String> replacement)
      Create a Scrubber to replace any match of the pattern with the result of the given replacement Function.
      Parameters:
      replacement - a function that receives the finding index and returns the replacement string
      Returns:
      a RegexScrubber to replace any match of the pattern with the result of the given replacement Function.
    • with

      public RegexScrubber with(String staticReplacement)
      Creates a new Scrubber to replace any match of the pattern with the given static replacement.
      Parameters:
      staticReplacement - the static replacement String
      Returns:
      a new RegexScrubber to replace any match of the pattern with the given staticReplacement.
    • withNumberedReplacement

      public RegexScrubber withNumberedReplacement()
      Creates a new Scrubber to replace strings matching the pattern with a numbered replacement.
      Returns:
      a new RegexScrubber using the RegexScrubber.NUMBERED_REPLACEMENT.