Interface DisplayHandler<T>
-
- Type Parameters:
T
- Type of content to display.
- All Known Implementing Classes:
InlineListDisplayHandler
,InlineMapDisplayHandler
,ListDisplayHandler
,PagedListDisplayHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface DisplayHandler<T>
Handles the formatting and sending of all content by theContentDisplay
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Collection<java.lang.String>
format(@NotNull org.bukkit.command.CommandSender sender, @NotNull ContentDisplay<T> display)
Formats the raw content into aCollection
for displaying to the given sender.default void
sendBody(@NotNull org.bukkit.command.CommandSender sender, @NotNull ContentDisplay<T> display, java.util.Collection<java.lang.String> formattedContent)
Sends the content.default void
sendHeader(@NotNull org.bukkit.command.CommandSender sender, @NotNull ContentDisplay<T> display)
Sends the header.default void
sendSubHeader(@NotNull org.bukkit.command.CommandSender sender, @NotNull ContentDisplay<T> display)
Sends info such as filter and page.
-
-
-
Method Detail
-
format
java.util.Collection<java.lang.String> format(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull ContentDisplay<T> display) throws DisplayFormatException
Formats the raw content into aCollection
for displaying to the given sender.- Parameters:
sender
- TheCommandSender
who will the content will be displayed to.display
- The responsibleContentDisplay
.- Returns:
- The formatted content.
- Throws:
DisplayFormatException
- Issue occurred while formatting content. E.g. invalid page.
-
sendHeader
default void sendHeader(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull ContentDisplay<T> display)
Sends the header.- Parameters:
sender
- TheCommandSender
who will the header will be displayed to.display
- The responsibleContentDisplay
.
-
sendSubHeader
default void sendSubHeader(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull ContentDisplay<T> display)
Sends info such as filter and page.- Parameters:
sender
- TheCommandSender
who will the sub header will be displayed to.display
- The responsibleContentDisplay
.
-
sendBody
default void sendBody(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull ContentDisplay<T> display, java.util.Collection<java.lang.String> formattedContent)
Sends the content.- Parameters:
sender
- TheCommandSender
who will the body will be displayed to.display
- The responsibleContentDisplay
.formattedContent
- The content after being formatted byformat(CommandSender, ContentDisplay)
-
-