Class ContentDisplay.Builder<T>
- java.lang.Object
-
- com.onarandombox.MultiverseCore.display.ContentDisplay.Builder<T>
-
- Type Parameters:
T
- Type of content to display.
- Enclosing class:
- ContentDisplay<T>
public static class ContentDisplay.Builder<T> extends java.lang.Object
Builds aContentDisplay
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ContentDisplay<T>
build()
Validates and build the content display.@NotNull ContentDisplay.Builder<T>
colorTool(@NotNull ColorTool colorTool)
Sets the color tool used to make messages more colourful.@NotNull ContentDisplay.Builder<T>
displayHandler(@NotNull DisplayHandler<T> displayHandler)
Sets the display handler that does the formatting and sending of content.@NotNull ContentDisplay.Builder<T>
emptyMessage(@NotNull java.lang.String emptyMessage, java.lang.Object... replacements)
Sets the message to show when no content is available for display.@NotNull ContentDisplay.Builder<T>
filter(@NotNull ContentFilter filter)
Sets content filter used to match specific content to be displayed.@NotNull ContentDisplay.Builder<T>
header(@NotNull java.lang.String header, java.lang.Object... replacements)
Sets header to be displayed.<S> @NotNull ContentDisplay.Builder<T>
setting(@NotNull DisplaySetting<S> setting, S value)
Sets other specific settings that may be used by theDisplayHandler
.void
show(org.bukkit.command.CommandSender sender)
Build and show the content to the sender.
-
-
-
Method Detail
-
header
@NotNull public @NotNull ContentDisplay.Builder<T> header(@NotNull @NotNull java.lang.String header, java.lang.Object... replacements)
Sets header to be displayed.- Parameters:
header
- The header text.replacements
- String formatting replacements.- Returns:
- The builder.
-
emptyMessage
@NotNull public @NotNull ContentDisplay.Builder<T> emptyMessage(@NotNull @NotNull java.lang.String emptyMessage, java.lang.Object... replacements)
Sets the message to show when no content is available for display.- Parameters:
emptyMessage
- The message text.replacements
- String formatting replacements.- Returns:
- The builder.
-
displayHandler
@NotNull public @NotNull ContentDisplay.Builder<T> displayHandler(@NotNull @NotNull DisplayHandler<T> displayHandler)
Sets the display handler that does the formatting and sending of content. Required.- Parameters:
displayHandler
- The display handler for the given content type.- Returns:
- The builder.
-
colorTool
@NotNull public @NotNull ContentDisplay.Builder<T> colorTool(@NotNull @NotNull ColorTool colorTool)
Sets the color tool used to make messages more colourful.- Parameters:
colorTool
- The color tool to use.- Returns:
- The builder.
-
filter
@NotNull public @NotNull ContentDisplay.Builder<T> filter(@NotNull @NotNull ContentFilter filter)
Sets content filter used to match specific content to be displayed.- Parameters:
filter
- The filter to use.- Returns:
- The builder.
-
setting
@NotNull public <S> @NotNull ContentDisplay.Builder<T> setting(@NotNull @NotNull DisplaySetting<S> setting, S value)
Sets other specific settings that may be used by theDisplayHandler
.- Type Parameters:
S
- The type of setting.- Parameters:
setting
- The settings option.value
- The value to set.- Returns:
- The builder.
-
build
@NotNull public @NotNull ContentDisplay<T> build()
Validates and build the content display.- Returns:
- The content display.
-
show
public void show(org.bukkit.command.CommandSender sender)
Build and show the content to the sender.- Parameters:
sender
- The CommandSender to show the display to.
-
-