Class ContentDisplay<T>
- java.lang.Object
-
- com.onarandombox.MultiverseCore.display.ContentDisplay<T>
-
- Type Parameters:
T- Type of content to display.
public class ContentDisplay<T> extends java.lang.ObjectHelps to display contents such as list and maps in a nicely formatted fashion.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContentDisplay.Builder<T>Builds aContentDisplay.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLINE_BREAK
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContentDisplay.Builder<java.util.Collection<java.lang.String>>forContent(java.util.Collection<java.lang.String> content)Creates a ContentDisplay.Builder for the given collection of content.static ContentDisplay.Builder<java.util.Map<java.lang.String,java.lang.Object>>forContent(java.util.Map<java.lang.String,java.lang.Object> content)Creates a ContentDisplay.Builder for the given map of content.static <T> ContentDisplay.Builder<T>forContent(T content)Creates a ContentDisplay.Builder for the given content.@NotNull ColorToolgetColorTool()TgetContents()@NotNull DisplayHandler<T>getDisplayHandler()@NotNull java.lang.StringgetEmptyMessage()@NotNull ContentFiltergetFilter()java.lang.StringgetHeader()<S> SgetSetting(@NotNull DisplaySetting<S> setting)Gets the value for a given setting option.voidsetHeader(@NotNull java.lang.String header)Sets the header text.<S> voidsetSetting(@NotNull DisplaySetting<S> setting, S value)Sets other specific settings that may be used by theDisplayHandler.voidshow(@NotNull org.bukkit.command.CommandSender sender)Do the actual displaying of contents to the sender.
-
-
-
Field Detail
-
LINE_BREAK
public static final java.lang.String LINE_BREAK
- See Also:
- Constant Field Values
-
-
Method Detail
-
forContent
public static <T> ContentDisplay.Builder<T> forContent(T content)
Creates a ContentDisplay.Builder for the given content.- Type Parameters:
T- The type of the content which can be inferred.- Parameters:
content- The content to be displayed.- Returns:
- A new Builder.
-
forContent
public static ContentDisplay.Builder<java.util.Collection<java.lang.String>> forContent(java.util.Collection<java.lang.String> content)
Creates a ContentDisplay.Builder for the given collection of content.- Parameters:
content- The content to be displayed.- Returns:
- A new Builder.
-
forContent
public static ContentDisplay.Builder<java.util.Map<java.lang.String,java.lang.Object>> forContent(java.util.Map<java.lang.String,java.lang.Object> content)
Creates a ContentDisplay.Builder for the given map of content.- Parameters:
content- The content to be displayed.- Returns:
- A new Builder.
-
show
public void show(@NotNull @NotNull org.bukkit.command.CommandSender sender)Do the actual displaying of contents to the sender.- Parameters:
sender- The CommandSender to show the display to.
-
getHeader
public java.lang.String getHeader()
- Returns:
- Gets the header to display.
-
setHeader
public void setHeader(@NotNull @NotNull java.lang.String header)Sets the header text.
-
getContents
public T getContents()
- Returns:
- Gets the contents to display.
-
getEmptyMessage
@NotNull public @NotNull java.lang.String getEmptyMessage()
- Returns:
- Gets the message to display when no content is shown.
-
getDisplayHandler
@NotNull public @NotNull DisplayHandler<T> getDisplayHandler()
- Returns:
- Gets the display handler that formats and sends content to sender.
-
getColorTool
@NotNull public @NotNull ColorTool getColorTool()
- Returns:
- Gets the color tool used.
-
getFilter
@NotNull public @NotNull ContentFilter getFilter()
- Returns:
- Gets the filter used.
-
getSetting
public <S> S getSetting(@NotNull @NotNull DisplaySetting<S> setting)Gets the value for a given setting option.- Type Parameters:
S- The setting type.- Parameters:
setting- The setting option.- Returns:
- Value set for the given setting.
-
setSetting
public <S> void setSetting(@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.
-
-