Interface ReplacementProcessor

All Known Implementing Classes:
PlaceholderProcessor

public interface ReplacementProcessor
Defines the contract for processing text and injecting dynamic data. This interface is responsible for taking a template (String or List of Strings) and applying a series of Replacement objects to produce the final output.
Since:
0.1
Author:
a8kj7sea
  • Method Summary

    Modifier and Type
    Method
    Description
    process(String text, Replacement... replacements)
    Processes a single string by applying the provided replacements.
    default List<String>
    process(List<String> lines, Replacement... replacements)
    Processes a list of strings (e.g., a configuration's lore or multi-line message).
  • Method Details

    • process

      String process(String text, Replacement... replacements)
      Processes a single string by applying the provided replacements.
      Parameters:
      text - the raw text containing placeholders.
      replacements - a varargs of Replacement to be applied.
      Returns:
      the processed string with all placeholders resolved.
      Since:
      0.1
    • process

      default List<String> process(List<String> lines, Replacement... replacements)
      Processes a list of strings (e.g., a configuration's lore or multi-line message). This default implementation uses Java Streams to map each line through the process(String, Replacement...) method.
      Parameters:
      lines - the list of template lines.
      replacements - a varargs of Replacement to be applied to every line.
      Returns:
      a new list containing the processed strings.
      Since:
      0.1