Interface MonkeyLibText
- All Known Subinterfaces:
ModdedMonkeyLibText
- All Known Implementing Classes:
MonkeyLibTextImpl
public interface MonkeyLibText
Abstraction around a vanilla Text. Use
of(String) to create instances.
Platform-specific implementation should store their MutableText equivalent and modify it when these methods are called.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionappend(MonkeyLibText other) Appends another text to this one.default MonkeyLibTextapplyStyle(UnaryOperator<MonkeyLibStyle> styleModifier) Applies the provided operations to this text's style.static MonkeyLibTextempty()Creates an empty literal text@Nullable MonkeyLibTextReturns the last sibling of this text.Gets the content of this textgetStyle()Gets the style of this text.static MonkeyLibTextCreates a literal textsetLastSibling(MonkeyLibText newSibling) Sets the last sibling of this text.setStyle(MonkeyLibStyle style) Sets the style of this text to the provided style.
-
Method Details
-
getLastSibling
@Nullable MonkeyLibText getLastSibling()Returns the last sibling of this text.- Returns:
- the last sibling of this text
-
setLastSibling
Sets the last sibling of this text.- Returns:
- this.
-
append
Appends another text to this one.- Parameters:
other- the text to append to this one- Returns:
- this.
-
getStyle
MonkeyLibStyle getStyle()Gets the style of this text.- Returns:
- The style of this text
-
setStyle
Sets the style of this text to the provided style.- Parameters:
style- the style to use.- Returns:
- this.
-
applyStyle
Applies the provided operations to this text's style.- Parameters:
styleModifier- the operations to apply.- Returns:
- this.
-
getString
String getString()Gets the content of this text- Returns:
- the content of this text
-
of
Creates a literal text- Parameters:
text- the text it should contain.- Returns:
- a literal text
-
empty
Creates an empty literal text- Returns:
- an empty text
-