Class Replacements

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

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 name)
      Replaces with "[name #]" where name is the given name and '#' is the number of the distinct replacement.
      Parameters:
      name - a String used to identify the replacement
      Returns:
      a replacement function that replaces with "[name #]"
    • 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