Class Replacements

java.lang.Object
org.approvej.scrub.Replacements

@NullMarked public class Replacements extends Object
Collection of replacement functions (Functions that take an Integer and return an Object) for use with Scrubbers.
  • Method Details

    • numbered

      public static Function<Integer,Object> numbered(String label)
      Replaces with "[label #]" where label is the given label and '#' is the number of the distinct replacement.
      Parameters:
      label - a String used to identify the replacement
      Returns:
      a replacement function that replaces with "[label #]"
    • numbered

      public static Function<Integer,Object> numbered()
      Replaces each match with "[scrubbed #]" where '#' is the number of the distinct replacement.
      Returns:
      a replacement function that replaces with "[scrubbed #]"
    • string

      public static Function<Integer,Object> string(String replacement)
      Replaces each match with the given static replacement string.
      Parameters:
      replacement - the static replacement string
      Returns:
      a replacement function that always returns the same string