Package com.winterhavenmc.library.messagebuilder.pipeline.adapters.name


package com.winterhavenmc.library.messagebuilder.pipeline.adapters.name
Provides the Nameable interface and its corresponding adapter used to extract and format name-related fields from objects passed into the message pipeline.

Objects that implement Nameable expose a getName() method used for macro substitution in message templates. The adapter in this package maps such values to a dot-notated macro key (e.g., {OBJECT.NAME}) that is automatically replaced during message composition.

Plugin Integration

Plugin developers can opt into this system by having their own domain types implement the Nameable interface. For example, a plugin-defined class:

public class CustomNPC implements Nameable {

    @Override
    public String getName() {
        return this.name;
    }
}

When a CustomNPC instance is passed into the macro context (via setMacro()), the message builder will automatically resolve the placeholder {CUSTOMNPC.NAME}.

Standard Support

This adapter also supports built-in Bukkit types such as:

  • CommandSender
  • OfflinePlayer
  • PlayerProfile
  • World
  • Server
  • Plugin
See Also:
  • Class
    Description
    A functional interface representing an object with a name field, commonly used in Adapter implementations that expose a getName() method.
    An Adapter for extracting name information from objects that expose a getName() method.