Record Class MessageSendEvent
java.lang.Object
java.lang.Record
net.flectone.pulse.model.event.message.MessageSendEvent
- Record Components:
cancelled- whether a listener suppressed this deliverymoduleName- the module the message came frommessage- the main textsubmessage- the secondary text, used by titles and toastseventMetadata- how the message is deliveredmessageContext- the message context for this receiver
- All Implemented Interfaces:
Event
public record MessageSendEvent(boolean cancelled, ModuleName moduleName, net.kyori.adventure.text.Component message, net.kyori.adventure.text.Component submessage, EventMetadata eventMetadata, MessageContext messageContext)
extends Record
implements Event
Fired for each receiver as the finished message goes out.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Event
Event.Priority -
Constructor Summary
ConstructorsConstructorDescriptionMessageSendEvent(boolean cancelled, ModuleName moduleName, net.kyori.adventure.text.Component message, net.kyori.adventure.text.Component submessage, EventMetadata eventMetadata, MessageContext messageContext) Creates an instance of aMessageSendEventrecord class.MessageSendEvent(ModuleName moduleName, net.kyori.adventure.text.Component message, net.kyori.adventure.text.Component submessage, EventMetadata eventMetadata, MessageContext messageContext) Creates an event that has not been cancelled. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecancelledrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theeventMetadatarecord component.final inthashCode()Returns a hash code value for this object.net.kyori.adventure.text.Componentmessage()Returns the value of themessagerecord component.Returns the value of themessageContextrecord component.Returns the value of themoduleNamerecord component.net.kyori.adventure.text.ComponentReturns the value of thesubmessagerecord component.final StringtoString()Returns a string representation of this record class.withCancelled(boolean cancelled) Returns a copy of this event with the cancelled flag set.withEventMetadata(EventMetadata eventMetadata) withMessage(net.kyori.adventure.text.Component message) withMessageContext(MessageContext messageContext) withModuleName(ModuleName moduleName) withSubmessage(net.kyori.adventure.text.Component submessage)
-
Constructor Details
-
MessageSendEvent
public MessageSendEvent(ModuleName moduleName, net.kyori.adventure.text.Component message, net.kyori.adventure.text.Component submessage, EventMetadata eventMetadata, MessageContext messageContext) Creates an event that has not been cancelled.- Parameters:
moduleName- the module the message came frommessage- the main textsubmessage- the secondary texteventMetadata- how the message is deliveredmessageContext- the message context for this receiver
-
MessageSendEvent
public MessageSendEvent(boolean cancelled, ModuleName moduleName, net.kyori.adventure.text.Component message, net.kyori.adventure.text.Component submessage, EventMetadata eventMetadata, MessageContext messageContext) Creates an instance of aMessageSendEventrecord class.- Parameters:
cancelled- the value for thecancelledrecord componentmoduleName- the value for themoduleNamerecord componentmessage- the value for themessagerecord componentsubmessage- the value for thesubmessagerecord componenteventMetadata- the value for theeventMetadatarecord componentmessageContext- the value for themessageContextrecord component
-
-
Method Details
-
withCancelled
Description copied from interface:EventReturns a copy of this event with the cancelled flag set.- Specified by:
withCancelledin interfaceEvent- Parameters:
cancelled- the new cancelled state- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withModuleName
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withMessage
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withSubmessage
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEventMetadata
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withMessageContext
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
cancelled
-
moduleName
Returns the value of themoduleNamerecord component.- Returns:
- the value of the
moduleNamerecord component
-
message
-
submessage
public net.kyori.adventure.text.Component submessage()Returns the value of thesubmessagerecord component.- Returns:
- the value of the
submessagerecord component
-
eventMetadata
Returns the value of theeventMetadatarecord component.- Returns:
- the value of the
eventMetadatarecord component
-
messageContext
Returns the value of themessageContextrecord component.- Returns:
- the value of the
messageContextrecord component
-