Package com.winterhavenmc.library.messagebuilder.core.maps


package com.winterhavenmc.library.messagebuilder.core.maps
Provides internal map types used in macro extraction and message formatting.

This package contains two core classes:

  • MacroObjectMap — a type-safe map that holds raw object values keyed by LegacyMacroKey. Used during early phases of the message pipeline, especially in adapter chains.
  • MacroStringMap — a post-processing map that contains validated, formatted string values ready for placeholder substitution.

Both maps serve distinct roles in the transformation of contextual input into localized, player-visible messages. The MacroObjectMap is typically used to carry domain-specific objects forward through the pipeline, whereas the MacroStringMap is constructed just before message composition and delivery.

Validation

MacroStringMap performs lightweight validation when values are inserted. Blank or null strings are flagged (typically for logging), but are not rejected. This ensures message macros are populated consistently, with the option to later replace missing values with default fallbacks such as "Unknown".

Immutability and Thread Safety

Both map types are mutable and are designed for use in single-threaded message construction contexts. They are not thread-safe by design.
See Also:
  • Classes
    Class
    Description
    A string-value map associating MacroKey keys with arbitrary Object values, used during macro substitution to store raw objects before formatting.
    A specialized map for storing string macro values keyed by ValidMacroKey.