public static class LiteralText.Builder extends Text.Builder
Text.Builder creating immutable LiteralText
instances.LiteralText| Modifier and Type | Method and Description |
|---|---|
LiteralText.Builder |
append(Collection<? extends Text> children)
Appends the specified
Text to the end of this text. |
LiteralText.Builder |
append(Iterable<? extends Text> children)
Appends the specified
Text to the end of this text. |
LiteralText.Builder |
append(Iterator<? extends Text> children)
Appends the specified
Text to the end of this text. |
LiteralText.Builder |
append(Text... children)
Appends the specified
Text to the end of this text. |
LiteralText |
build()
Builds an immutable instance of the current state of this text
builder.
|
LiteralText.Builder |
color(TextColor color)
Sets the
TextColor of this text. |
LiteralText.Builder |
content(String content)
Sets the plain text content of this text.
|
boolean |
equals(Object o) |
LiteralText.Builder |
format(TextFormat format)
Sets the
TextFormat of this text. |
String |
getContent()
Returns the current content of this builder.
|
int |
hashCode() |
LiteralText.Builder |
insert(int pos,
Collection<? extends Text> children)
Inserts the specified
Text at the given position of this
builder. |
LiteralText.Builder |
insert(int pos,
Iterable<? extends Text> children)
Inserts the specified
Text at the given position of this
builder. |
LiteralText.Builder |
insert(int pos,
Iterator<? extends Text> children)
Inserts the specified
Text at the given position of this
builder. |
LiteralText.Builder |
insert(int pos,
Text... children)
Inserts the specified
Text at the given position of this
builder. |
LiteralText.Builder |
onClick(ClickAction<?> clickAction)
Sets the
ClickAction that will be executed if the text is
clicked in the chat. |
LiteralText.Builder |
onHover(HoverAction<?> hoverAction)
Sets the
HoverAction that will be executed if the text is
hovered in the chat. |
LiteralText.Builder |
onShiftClick(ShiftClickAction<?> shiftClickAction)
Sets the
ShiftClickAction that will be executed if the text
is shift-clicked in the chat. |
LiteralText.Builder |
remove(Collection<? extends Text> children)
Removes the specified
Text from this builder. |
LiteralText.Builder |
remove(Iterable<? extends Text> children)
Removes the specified
Text from this builder. |
LiteralText.Builder |
remove(Iterator<? extends Text> children)
Removes the specified
Text from this builder. |
LiteralText.Builder |
remove(Text... children)
Removes the specified
Text from this builder. |
LiteralText.Builder |
removeAll()
Removes all children from this builder.
|
LiteralText.Builder |
style(TextStyle... styles)
Sets the text styles of this text.
|
getChildren, getClickAction, getColor, getFormat, getHoverAction, getShiftClickAction, getStyle, remove, removeLastChild, toString, toText, trimclone, finalize, getClass, notify, notifyAll, wait, wait, waitapplyTopublic final String getContent()
LiteralText.getContent()public LiteralText.Builder content(String content)
content - The content of this textLiteralText.getContent()public LiteralText build()
Text.Builderbuild in class Text.BuilderText with the current properties of this
builderpublic boolean equals(@Nullable Object o)
equals in class Text.Builderpublic int hashCode()
hashCode in class Text.Builderpublic LiteralText.Builder format(TextFormat format)
Text.BuilderTextFormat of this text.format in class Text.Builderformat - The new text format for this textText.getFormat()public LiteralText.Builder color(TextColor color)
Text.BuilderTextColor of this text.color in class Text.Buildercolor - The new text color for this textText.getColor()public LiteralText.Builder style(TextStyle... styles)
Text.BuilderTextStyle of the current style and the specified styles first
and set it to the text.style in class Text.Builderstyles - The text styles to applyText.getStyle()public LiteralText.Builder onClick(@Nullable ClickAction<?> clickAction)
Text.BuilderClickAction that will be executed if the text is
clicked in the chat.onClick in class Text.BuilderclickAction - The new click action for the textText.getClickAction()public LiteralText.Builder onHover(@Nullable HoverAction<?> hoverAction)
Text.BuilderHoverAction that will be executed if the text is
hovered in the chat.onHover in class Text.BuilderhoverAction - The new hover action for the textText.getHoverAction()public LiteralText.Builder onShiftClick(@Nullable ShiftClickAction<?> shiftClickAction)
Text.BuilderShiftClickAction that will be executed if the text
is shift-clicked in the chat.onShiftClick in class Text.BuildershiftClickAction - The new shift click action for the textText.getShiftClickAction()public LiteralText.Builder append(Text... children)
Text.BuilderText to the end of this text.append in class Text.Builderchildren - The texts to appendText.getChildren()public LiteralText.Builder append(Collection<? extends Text> children)
Text.BuilderText to the end of this text.append in class Text.Builderchildren - The texts to appendText.getChildren()public LiteralText.Builder append(Iterable<? extends Text> children)
Text.BuilderText to the end of this text.append in class Text.Builderchildren - The texts to appendText.getChildren()public LiteralText.Builder append(Iterator<? extends Text> children)
Text.BuilderText to the end of this text.append in class Text.Builderchildren - The texts to appendText.getChildren()public LiteralText.Builder insert(int pos, Text... children)
Text.BuilderText at the given position of this
builder.insert in class Text.Builderpos - The position to insert the texts tochildren - The texts to insertText.getChildren()public LiteralText.Builder insert(int pos, Collection<? extends Text> children)
Text.BuilderText at the given position of this
builder.insert in class Text.Builderpos - The position to insert the texts tochildren - The texts to insertText.getChildren()public LiteralText.Builder insert(int pos, Iterable<? extends Text> children)
Text.BuilderText at the given position of this
builder.insert in class Text.Builderpos - The position to insert the texts tochildren - The texts to insertText.getChildren()public LiteralText.Builder insert(int pos, Iterator<? extends Text> children)
Text.BuilderText at the given position of this
builder.insert in class Text.Builderpos - The position to insert the texts tochildren - The texts to insertText.getChildren()public LiteralText.Builder remove(Text... children)
Text.BuilderText from this builder.remove in class Text.Builderchildren - The texts to removeText.getChildren()public LiteralText.Builder remove(Collection<? extends Text> children)
Text.BuilderText from this builder.remove in class Text.Builderchildren - The texts to removeText.getChildren()public LiteralText.Builder remove(Iterable<? extends Text> children)
Text.BuilderText from this builder.remove in class Text.Builderchildren - The texts to removeText.getChildren()public LiteralText.Builder remove(Iterator<? extends Text> children)
Text.BuilderText from this builder.remove in class Text.Builderchildren - The texts to removeText.getChildren()public LiteralText.Builder removeAll()
Text.BuilderremoveAll in class Text.BuilderText.getChildren()