Class InteractiveMessagePart
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<TextMessagePart>
me.wiefferink.interactivemessenger.message.InteractiveMessagePart
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<TextMessagePart>
,Collection<TextMessagePart>
,Deque<TextMessagePart>
,List<TextMessagePart>
,Queue<TextMessagePart>
Holds a string with interactive formatting.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the click actionGet the click contentGet the hover actionGet the hover contentint
hashCode()
boolean
Check if the next part should start on a new lineboolean
Check if there are interactive actions definednewline()
Start a new line after this partnewline(boolean newline)
Start or don't start a new line after this partDon't start a new line after this partSet the click actiononClickContent(String clickContent)
Set the click contentSet the hover actiononHoverContent(List<TextMessagePart> hoverContent)
Set the hover contenttoString()
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
Methods inherited from class java.util.AbstractSequentialList
iterator
Methods inherited from class java.util.AbstractList
listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
containsAll, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Constructor Details
-
InteractiveMessagePart
public InteractiveMessagePart()
-
-
Method Details
-
newline
Start a new line after this part- Returns:
- this
-
noNewline
Don't start a new line after this part- Returns:
- this
-
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
Set the click action- Parameters:
onClick
- The click action to use or null for none- Returns:
- this
-
getOnClick
Get the click action- Returns:
- The click action or null for none
-
onClickContent
Set the click content- Parameters:
clickContent
- The content used by the click action- Returns:
- this
-
getOnClickContent
Get the click content- Returns:
- The click content
-
onHover
Set the hover action- Parameters:
onHover
- The hover action to use or null for none- Returns:
- this
-
getOnHover
Get the hover action- Returns:
- The hover action or null for none
-
onHoverContent
Set the hover content- Parameters:
hoverContent
- The content used by the hover action, never null- Returns:
- this
-
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
- Overrides:
toString
in classAbstractCollection<TextMessagePart>
-
equals
- Specified by:
equals
in interfaceCollection<TextMessagePart>
- Specified by:
equals
in interfaceList<TextMessagePart>
- Overrides:
equals
in classAbstractList<TextMessagePart>
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection<TextMessagePart>
- Specified by:
hashCode
in interfaceList<TextMessagePart>
- Overrides:
hashCode
in classAbstractList<TextMessagePart>
-