Class InteractiveMessagePart

All Implemented Interfaces:
Serializable, Cloneable, Iterable<TextMessagePart>, Collection<TextMessagePart>, Deque<TextMessagePart>, List<TextMessagePart>, Queue<TextMessagePart>

public class InteractiveMessagePart extends LinkedList<TextMessagePart>
Holds a string with interactive formatting.
See Also:
Serialized Form
  • Constructor Details

    • InteractiveMessagePart

      public InteractiveMessagePart()
  • Method Details

    • newline

      public InteractiveMessagePart newline()
      Start a new line after this part
      Returns:
      this
    • noNewline

      public InteractiveMessagePart noNewline()
      Don't start a new line after this part
      Returns:
      this
    • newline

      public InteractiveMessagePart newline(boolean newline)
      Start or don't start a new line after this part
      Parameters:
      newline - true to start a new line after this part, otherwise false
      Returns:
      this
    • hasNewline

      public boolean hasNewline()
      Check if the next part should start on a new line
      Returns:
      true if the next part should start on a new line, otherwise false
    • onClick

      public InteractiveMessagePart onClick(Click onClick)
      Set the click action
      Parameters:
      onClick - The click action to use or null for none
      Returns:
      this
    • getOnClick

      public Click getOnClick()
      Get the click action
      Returns:
      The click action or null for none
    • onClickContent

      public InteractiveMessagePart onClickContent(String clickContent)
      Set the click content
      Parameters:
      clickContent - The content used by the click action
      Returns:
      this
    • getOnClickContent

      public String getOnClickContent()
      Get the click content
      Returns:
      The click content
    • onHover

      public InteractiveMessagePart onHover(Hover onHover)
      Set the hover action
      Parameters:
      onHover - The hover action to use or null for none
      Returns:
      this
    • getOnHover

      public Hover getOnHover()
      Get the hover action
      Returns:
      The hover action or null for none
    • onHoverContent

      public InteractiveMessagePart onHoverContent(List<TextMessagePart> hoverContent)
      Set the hover content
      Parameters:
      hoverContent - The content used by the hover action, never null
      Returns:
      this
    • getOnHoverContent

      public LinkedList<TextMessagePart> getOnHoverContent()
      Get the hover content
      Returns:
      The hover content, never null
    • isInteractive

      public boolean isInteractive()
      Check if there are interactive actions defined
      Returns:
      true if there is a hover or click event addd, false if it is only text
    • toString

      public String toString()
      Overrides:
      toString in class AbstractCollection<TextMessagePart>
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<TextMessagePart>
      Specified by:
      equals in interface List<TextMessagePart>
      Overrides:
      equals in class AbstractList<TextMessagePart>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Collection<TextMessagePart>
      Specified by:
      hashCode in interface List<TextMessagePart>
      Overrides:
      hashCode in class AbstractList<TextMessagePart>