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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the click actionGet the click contentGet the hover actionGet the hover contentinthashCode()booleanCheck if the next part should start on a new linebooleanCheck 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, toArrayMethods inherited from class java.util.AbstractSequentialList
iteratorMethods inherited from class java.util.AbstractList
listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods 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:
toStringin classAbstractCollection<TextMessagePart>
-
equals
- Specified by:
equalsin interfaceCollection<TextMessagePart>- Specified by:
equalsin interfaceList<TextMessagePart>- Overrides:
equalsin classAbstractList<TextMessagePart>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<TextMessagePart>- Specified by:
hashCodein interfaceList<TextMessagePart>- Overrides:
hashCodein classAbstractList<TextMessagePart>
-