Class DisplayNameAdapter
java.lang.Object
com.winterhavenmc.library.messagebuilder.adapters.pipeline.accessors.displayname.DisplayNameAdapter
- All Implemented Interfaces:
Accessor
Accessor implementation for extracting display names from supported object types.
This adapter converts objects into DisplayNameable instances to support macro
replacement using the {OBJECT.DISPLAY_NAME} placeholder.
Supported types include:
- Objects implementing
DisplayNameable Player— mapped toPlayer.getDisplayName()Nameable— mapped toNameable.getCustomName()World— mapped using theWorldNameResolver
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.winterhavenmc.library.messagebuilder.core.ports.pipeline.accessors.Accessor
Accessor.BuiltIn -
Field Summary
Fields inherited from interface com.winterhavenmc.library.messagebuilder.core.ports.pipeline.accessors.Accessor
UNKNOWN_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newDisplayNameAdapterwith the given context container. -
Method Summary
Modifier and TypeMethodDescriptionAttempts to adapt the given object to aDisplayNameableinstance.
-
Constructor Details
-
DisplayNameAdapter
Constructs a newDisplayNameAdapterwith the given context container.- Parameters:
ctx- the adapter context providing services such as world name resolution
-
-
Method Details
-
adapt
Attempts to adapt the given object to aDisplayNameableinstance.
-