Class MessageComposer
java.lang.Object
de.eldoria.eldoutilities.localization.MessageComposer
- All Implemented Interfaces:
IMessageComposer
Class to compose localized messages.
Handles escaping and concatenation of messages.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
buildLocalized
(ILocalizer localizer) static MessageComposer
create()
static String
fillLines
(int lines) localeCode
(String propertyKey, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... replacements) newLine()
prependLines
(int lines) List<net.kyori.adventure.text.minimessage.tag.resolver.TagResolver>
space()
space
(int spaces) Add a object to the message as string.Add a string to the message.text
(Collection<String> messages) Add a list of messages with a delimiter as string.text
(Collection<String> messages, String delimiter) Add a list of messages with a delimiter as string.
-
Method Details
-
create
-
escape
-
localeCode
public MessageComposer localeCode(@Language("properties") String propertyKey, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... replacements) -
tag
-
text
Add a string to the message.This also allows to use a string format like
String.format(String, Object...)
- Parameters:
text
- text to addobjects
- objects for placeholder- Returns:
- this instance
-
text
Add a object to the message as string.- Parameters:
object
- object to add- Returns:
- this instance
-
text
Add a list of messages with a delimiter as string.- Parameters:
messages
- messages to add- Returns:
- this instance
-
text
Add a list of messages with a delimiter as string.- Parameters:
messages
- messages to adddelimiter
- delimiter to join- Returns:
- this instance
-
space
-
space
-
fillLines
-
fillLines
-
prependLines
-
prependLines
-
newLine
-
build
- Specified by:
build
in interfaceIMessageComposer
-
replacements
- Specified by:
replacements
in interfaceIMessageComposer
-
buildLocalized
-