@Contract("_ -> this")
    default @NotNull Builder replacement(final @NotNull Function<TextComponent.Builder, @Nullable ComponentLike> replacement) {
      requireNonNull(replacement, "replacement");
      return this.replacement((result, input) -> replacement.apply(input));

    }
Supply a function that provides replacements for each match.

@param replacement the replacement function
@return this builder
@since 4.2.0
api/src/main/java/net/kyori/adventure/text/TextReplacementConfig.java