public interface MessageEvent extends Event
Text
message.Modifier and Type | Interface and Description |
---|---|
static class |
MessageEvent.DefaultBodyApplier
Represents the initial body set by the implementation before the event
is posted.
|
static class |
MessageEvent.DefaultHeaderApplier
Represents the initial header set by the implementation before the event
is posted.
|
static class |
MessageEvent.MessageFormatter
Formatter used for formatting messages within this event.
|
Modifier and Type | Field and Description |
---|---|
static String |
PARAM_MESSAGE_BODY
Parameter for body section in body partition.
|
static String |
PARAM_MESSAGE_FOOTER
Parameter for footer section in footer partition.
|
static String |
PARAM_MESSAGE_HEADER
Parameter for header section in header partition.
|
Modifier and Type | Method and Description |
---|---|
default MessageEvent.MessageFormatter |
clearMessage()
Clears the currently set message and returns the empty formatter.
|
MessageEvent.MessageFormatter |
getFormatter()
Returns the
MessageEvent.MessageFormatter used to mutate the event's message. |
default Text |
getMessage()
Returns the formatted message.
|
Text |
getOriginalMessage()
Gets the original
Text message. |
boolean |
isMessageCancelled()
Returns true if the
Text returned by
getMessage() should not be sent. |
default void |
setMessage(TextRepresentable body)
Clears any existing components and sets the body.
|
default void |
setMessage(TextRepresentable header,
TextRepresentable body)
Clears any existing components and sets the header and body
respectively.
|
default void |
setMessage(TextRepresentable header,
TextRepresentable body,
TextRepresentable footer)
Clears any existing components and sets the header, body, and footer
respectively.
|
void |
setMessageCancelled(boolean cancelled)
Sets whether the
Text returned by
getMessage() should be sent. |
getCause, getContext, getSource
static final String PARAM_MESSAGE_HEADER
static final String PARAM_MESSAGE_BODY
static final String PARAM_MESSAGE_FOOTER
boolean isMessageCancelled()
Text
returned by
getMessage()
should not be sent.void setMessageCancelled(boolean cancelled)
Text
returned by
getMessage()
should be sent.cancelled
- True if should not be sentMessageEvent.MessageFormatter getFormatter()
MessageEvent.MessageFormatter
used to mutate the event's message.default Text getMessage()
default MessageEvent.MessageFormatter clearMessage()
MessageEvent.MessageFormatter
default void setMessage(TextRepresentable header, TextRepresentable body, TextRepresentable footer)
header
- Header valuebody
- Body valuefooter
- Footer valuedefault void setMessage(TextRepresentable header, TextRepresentable body)
header
- Header valuebody
- Body valuedefault void setMessage(TextRepresentable body)
body
- Body value