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 aCollectionfor displaying to the given sender.default voidsendBody(@NotNull org.bukkit.command.CommandSender sender, @NotNull ContentDisplay<T> display, java.util.Collection<java.lang.String> formattedContent)Sends the content.default voidsendHeader(@NotNull org.bukkit.command.CommandSender sender, @NotNull ContentDisplay<T> display)Sends the header.default voidsendSubHeader(@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 DisplayFormatExceptionFormats the raw content into aCollectionfor displaying to the given sender.- Parameters:
sender- TheCommandSenderwho 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- TheCommandSenderwho 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- TheCommandSenderwho 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- TheCommandSenderwho will the body will be displayed to.display- The responsibleContentDisplay.formattedContent- The content after being formatted byformat(CommandSender, ContentDisplay)
-
-