Package com.winterhavenmc.library.messagebuilder.model.recipient


package com.winterhavenmc.library.messagebuilder.model.recipient
Contains a sealed model hierarchy representing classified message recipients in a Bukkit-based command or messaging context.

The Recipient interface and its nested types allow plugin developers to reason about the type of a CommandSender at runtime using a type-safe, data-driven approach.

Recipient Categories

  • Recipient.Valid – A standard, recognized sender such as a player, console, or command block
  • Recipient.Proxied – A ProxiedCommandSender that represents a delegated command flow
  • Recipient.Invalid – A null or unsupported sender, accompanied by a reason code

Usage

The factory method Recipient.of(CommandSender) is used to classify any incoming CommandSender, and returns a sealed Recipient subtype appropriate to its role.
 Recipient recipient = Recipient.of(sender);
 if (recipient instanceof Recipient.Sendable sendable) {
     sendable.sender().sendMessage("Welcome!");
 }
This model is typically used by the message dispatch layer of the library to safely and clearly manage how messages are sent based on the sender's context.
See Also: