Package com.winterhavenmc.library.messagebuilder.core.message
package com.winterhavenmc.library.messagebuilder.core.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 string, a macro object map, and aMessagePipelineInvalidMessage– 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 bycom.winterhavenmc.library.messagebuilder.MessageBuilder:
messageBuilder.compose(sender, MessageId.LOGIN_SUCCESS)
.setMacro(Macro.PLAYER, player)
.send();
If the recipient or message string is invalid, the library will return an
InvalidMessage, which safely performs no action when sent.
- See Also:
-
ClassDescriptionA fallback
Messageimplementation representing an invalid or unrenderable message.A sealed interface representing a message that can be composed using macros and sent to a valid recipient.A concrete implementation ofMessagerepresenting a fully constructed, resolvable, and sendable message.