Interface Replacer
- All Known Implementing Classes:
MacroReplacer
public interface Replacer
A functional interface representing a macro replacement engine that substitutes
placeholder values within a message string using data from a
MacroObjectMap
.
This interface abstracts the final stage in the message-building pipeline, where
macros (e.g., %PLAYER_NAME%
, %LOCATION_X%
) are resolved to actual
string values prior to display.
Implementations must ensure that all macros present in the input string are
replaced using context objects available in the provided MacroObjectMap
.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionreplace
(MacroObjectMap macroObjectMap, String messageString) Replaces all macro placeholders in the provided message string using values from the given macro object map.
-
Method Details
-
replace
Replaces all macro placeholders in the provided message string using values from the given macro object map.- Parameters:
macroObjectMap
- a map of macro keys to context objectsmessageString
- the input message string containing one or more macros- Returns:
- the fully formatted string with all resolvable macros replaced
-