Class TextMessagePart
java.lang.Object
me.wiefferink.interactivemessenger.message.TextMessagePart
Holds a string with basic (non-interactive) formatting.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappendText(String toAppend)
Append to the current textSet the colorboolean
format(Collection<Format> formatting)
Add formattingAdd formattinggetColor()
Get the colorGet the formatting of this partgetText()
Get the text of this partboolean
Check if this part has formattingint
hashCode()
Set the texttoString()
-
Constructor Details
-
TextMessagePart
public TextMessagePart()
-
-
Method Details
-
text
Set the text- Parameters:
text
- The text to set (if null text will be set to an empty string)- Returns:
- this
-
appendText
Append to the current text- Parameters:
toAppend
- The string to append (null is ignored)- Returns:
- this
-
getText
Get the text of this part- Returns:
- The text, never null
-
color
Set the color- Parameters:
color
- The color to set (if null it defaults to white)- Returns:
- this
-
getColor
Get the color- Returns:
- The color, never null
-
format
Add formatting- Parameters:
formatting
- The formatting to add- Returns:
- this
-
format
Add formatting- Parameters:
formatting
- The formatting to add- Returns:
- this
-
getFormatting
Get the formatting of this part- Returns:
- The formattting of this part, never null
-
hasFormatting
public boolean hasFormatting()Check if this part has formatting- Returns:
- true if this part has formatting, otherwise false
-
toString
-
equals
-
hashCode
public int hashCode()
-