Class DisplayNameAdapter
java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.adapters.displayname.DisplayNameAdapter
- All Implemented Interfaces:
Adapter
Adapter 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.pipeline.adapters.Adapter
Adapter.BuiltIn
-
Field Summary
Fields inherited from interface com.winterhavenmc.library.messagebuilder.pipeline.adapters.Adapter
UNKNOWN_VALUE
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newDisplayNameAdapter
with the given context container. -
Method Summary
Modifier and TypeMethodDescriptionAttempts to adapt the given object to aDisplayNameable
instance.
-
Constructor Details
-
DisplayNameAdapter
Constructs a newDisplayNameAdapter
with 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 aDisplayNameable
instance.
-