Package com.booksaw.betterTeams.message
Class MessageConfig.MessageBuilder
java.lang.Object
com.booksaw.betterTeams.message.MessageConfig.MessageBuilder
- Enclosing class:
MessageConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Stringbuild()Builds the final message string.@NotNull MessageConfigGets the underlying MessageConfig.@NotNull MessageConfig.MessageBuilderReplaces a named placeholder with a value.@NotNull MessageConfig.MessageBuilderReplaces multiple placeholders from a map.@NotNull MessageConfig.MessageBuilderwithPAPI(@Nullable org.bukkit.entity.Player player) Applies PlaceholderAPI placeholders for a player.
-
Constructor Details
-
MessageBuilder
-
-
Method Details
-
with
@NotNull public @NotNull MessageConfig.MessageBuilder with(@NotNull @NotNull String key, @Nullable @Nullable Object value) Replaces a named placeholder with a value.- Parameters:
key- The placeholder key (without braces)value- The replacement value- Returns:
- This builder for chaining
-
withAll
@NotNull public @NotNull MessageConfig.MessageBuilder withAll(@NotNull @NotNull Map<String, Object> placeholders) Replaces multiple placeholders from a map.- Parameters:
placeholders- Map of key-value pairs- Returns:
- This builder for chaining
-
withPAPI
@NotNull public @NotNull MessageConfig.MessageBuilder withPAPI(@Nullable @Nullable org.bukkit.entity.Player player) Applies PlaceholderAPI placeholders for a player.- Parameters:
player- The player for PlaceholderAPI- Returns:
- This builder for chaining
-
build
Builds the final message string.- Returns:
- The formatted message
-
getConfig
Gets the underlying MessageConfig.- Returns:
- The message config
-