Package com.winterhavenmc.library.messagebuilder.model.message


package com.winterhavenmc.library.messagebuilder.model.message
Contains the sealed Message interface and its implementations, which represent composed messages ready for macro substitution and delivery.

A Message is constructed through the library's fluent builder API, with macro values bound dynamically to placeholders. Once composed, the message can be dispatched using Message.send().

Message Implementations

This package defines two implementations:
  • ValidMessage – A fully constructed and resolvable message that contains a valid recipient, a message template key, a macro object map, and a MessagePipeline
  • InvalidMessage – A fallback or no-op message representing a failure to compose a valid message, typically due to missing or null input

Usage

Developers do not typically instantiate message types directly. Instead, messages are created via the fluent API exposed by MessageBuilder:
messageBuilder.compose(sender, MessageId.LOGIN_SUCCESS)
              .setMacro(Macro.PLAYER, player)
              .send();

If the recipient or message key is invalid, the library will return an InvalidMessage, which safely performs no action when sent.

See Also: