public static class TextBuilder.Placeholder extends TextBuilder
TextBuilder
creating immutable
Text.Placeholder
instances.Text.Placeholder
TextBuilder.Literal, TextBuilder.Placeholder, TextBuilder.Score, TextBuilder.Selector, TextBuilder.Translatable
children, clickAction, format, hoverAction, shiftClickAction
Modifier and Type | Method and Description |
---|---|
TextBuilder.Placeholder |
append(Iterable<? extends Text> children)
Appends the specified
Text to the end of this text. |
TextBuilder.Placeholder |
append(Text... children)
Appends the specified
Text to the end of this text. |
Text.Placeholder |
build()
Builds an immutable instance of the current state of this text builder.
|
TextBuilder.Placeholder |
color(TextColor color)
Sets the
TextColor of this text. |
boolean |
equals(Object o) |
TextBuilder.Placeholder |
fallback(Text fallback)
Sets the fallback text that will be used if no value is present for this placeholder
|
String |
getKey()
Returns the current replacement key of this builder.
|
int |
hashCode() |
TextBuilder.Placeholder |
insert(int pos,
Iterable<? extends Text> children)
Inserts the specified
Text at the given position of this builder. |
TextBuilder.Placeholder |
insert(int pos,
Text... children)
Inserts the specified
Text at the given position of this builder. |
TextBuilder.Placeholder |
key(String key)
Sets the plain text replacement key of this text.
|
TextBuilder.Placeholder |
onClick(ClickAction<?> clickAction)
Sets the
ClickAction that will be executed if the text is clicked
in the chat. |
TextBuilder.Placeholder |
onHover(HoverAction<?> hoverAction)
Sets the
HoverAction that will be executed if the text is hovered
in the chat. |
TextBuilder.Placeholder |
onShiftClick(ShiftClickAction<?> shiftClickAction)
Sets the
ShiftClickAction that will be executed if the text is
shift-clicked in the chat. |
TextBuilder.Placeholder |
remove(Iterable<? extends Text> children)
Removes the specified
Text from this builder. |
TextBuilder.Placeholder |
remove(Text... children)
Removes the specified
Text from this builder. |
TextBuilder.Placeholder |
removeAll()
Removes all children from this builder.
|
TextBuilder.Placeholder |
style(TextStyle... styles)
Sets the text styles of this text.
|
String |
toString() |
format, getChildren, getClickAction, getColor, getFormat, getHoverAction, getShiftClickAction, getStyle, toText
public final String getKey()
Text.Placeholder.getKey()
public TextBuilder.Placeholder key(String key)
key
- The key of this textText.Placeholder.getKey()
public TextBuilder.Placeholder fallback(Text fallback)
fallback
- The content of this textText.Placeholder.getFallback()
public Text.Placeholder build()
TextBuilder
build
in class TextBuilder
Text
with the current properties of this
builderpublic boolean equals(@Nullable Object o)
equals
in class TextBuilder
public int hashCode()
hashCode
in class TextBuilder
public String toString()
toString
in class TextBuilder
public TextBuilder.Placeholder color(TextColor color)
TextBuilder
TextColor
of this text.color
in class TextBuilder
color
- The new text color for this textText.getColor()
public TextBuilder.Placeholder style(TextStyle... styles)
TextBuilder
TextStyle
of the current style and the specified styles first and
set it to the text.style
in class TextBuilder
styles
- The text styles to applyText.getStyle()
public TextBuilder.Placeholder onClick(@Nullable ClickAction<?> clickAction)
TextBuilder
ClickAction
that will be executed if the text is clicked
in the chat.onClick
in class TextBuilder
clickAction
- The new click action for the textText.getClickAction()
public TextBuilder.Placeholder onHover(@Nullable HoverAction<?> hoverAction)
TextBuilder
HoverAction
that will be executed if the text is hovered
in the chat.onHover
in class TextBuilder
hoverAction
- The new hover action for the textText.getHoverAction()
public TextBuilder.Placeholder onShiftClick(@Nullable ShiftClickAction<?> shiftClickAction)
TextBuilder
ShiftClickAction
that will be executed if the text is
shift-clicked in the chat.onShiftClick
in class TextBuilder
shiftClickAction
- The new shift click action for the textText.getShiftClickAction()
public TextBuilder.Placeholder append(Text... children)
TextBuilder
Text
to the end of this text.append
in class TextBuilder
children
- The texts to appendText.getChildren()
public TextBuilder.Placeholder append(Iterable<? extends Text> children)
TextBuilder
Text
to the end of this text.append
in class TextBuilder
children
- The texts to appendText.getChildren()
public TextBuilder.Placeholder insert(int pos, Text... children)
TextBuilder
Text
at the given position of this builder.insert
in class TextBuilder
pos
- The position to insert the texts tochildren
- The texts to insertText.getChildren()
public TextBuilder.Placeholder insert(int pos, Iterable<? extends Text> children)
TextBuilder
Text
at the given position of this builder.insert
in class TextBuilder
pos
- The position to insert the texts tochildren
- The texts to insertText.getChildren()
public TextBuilder.Placeholder remove(Text... children)
TextBuilder
Text
from this builder.remove
in class TextBuilder
children
- The texts to removeText.getChildren()
public TextBuilder.Placeholder remove(Iterable<? extends Text> children)
TextBuilder
Text
from this builder.remove
in class TextBuilder
children
- The texts to removeText.getChildren()
public TextBuilder.Placeholder removeAll()
TextBuilder
removeAll
in class TextBuilder
Text.getChildren()