Class TextMessagePart

java.lang.Object
me.wiefferink.interactivemessenger.message.TextMessagePart

public class TextMessagePart extends Object
Holds a string with basic (non-interactive) formatting.
  • Constructor Details

    • TextMessagePart

      public TextMessagePart()
  • Method Details

    • text

      public TextMessagePart text(String text)
      Set the text
      Parameters:
      text - The text to set (if null text will be set to an empty string)
      Returns:
      this
    • appendText

      public TextMessagePart appendText(String toAppend)
      Append to the current text
      Parameters:
      toAppend - The string to append (null is ignored)
      Returns:
      this
    • getText

      public String getText()
      Get the text of this part
      Returns:
      The text, never null
    • color

      public TextMessagePart color(Color color)
      Set the color
      Parameters:
      color - The color to set (if null it defaults to white)
      Returns:
      this
    • getColor

      public Color getColor()
      Get the color
      Returns:
      The color, never null
    • format

      public TextMessagePart format(Format... formatting)
      Add formatting
      Parameters:
      formatting - The formatting to add
      Returns:
      this
    • format

      public TextMessagePart format(Collection<Format> formatting)
      Add formatting
      Parameters:
      formatting - The formatting to add
      Returns:
      this
    • getFormatting

      public Set<Format> 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

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object