Record Class ProxyMessageEvent
java.lang.Object
java.lang.Record
net.flectone.pulse.model.event.message.ProxyMessageEvent
- Record Components:
cancelled- whether a listener vetoed handlingprocessed- whether a listener already handled it, so the default handling is skippedsentByThisServer- whether this server is the origin, echoed back by the proxyserver- the originating server namename- the module the message came fromsender- the entity that sent ituuid- the id shared by every copy of this messagepayload- the raw extra data written by the sender
- All Implemented Interfaces:
Event
-
Nested Class Summary
Nested classes/interfaces inherited from interface Event
Event.Priority -
Constructor Summary
ConstructorsConstructorDescriptionProxyMessageEvent(boolean cancelled, boolean processed, boolean sentByThisServer, String server, ModuleName name, FEntity sender, UUID uuid, byte[] payload) Creates an instance of aProxyMessageEventrecord class.ProxyMessageEvent(boolean sentByThisServer, String server, ModuleName name, FEntity sender, UUID uuid, byte[] payload) Creates an event that has been neither cancelled nor processed. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecancelledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Opens the extra data for reading, in the same order the sender wrote it.byte[]payload()Returns the value of thepayloadrecord component.booleanReturns the value of theprocessedrecord component.sender()Returns the value of thesenderrecord component.booleanReturns the value of thesentByThisServerrecord component.server()Returns the value of theserverrecord component.final StringtoString()Returns a string representation of this record class.uuid()Returns the value of theuuidrecord component.withCancelled(boolean cancelled) Returns a copy of this event with the cancelled flag set.withName(ModuleName name) withPayload(byte[] payload) withProcessed(boolean processed) withSender(FEntity sender) withSentByThisServer(boolean sentByThisServer) withServer(String server)
-
Constructor Details
-
ProxyMessageEvent
public ProxyMessageEvent(boolean sentByThisServer, String server, ModuleName name, FEntity sender, UUID uuid, byte[] payload) Creates an event that has been neither cancelled nor processed.- Parameters:
sentByThisServer- whether this server is the originserver- the originating server namename- the module the message came fromsender- the entity that sent ituuid- the shared message idpayload- the raw extra data
-
ProxyMessageEvent
public ProxyMessageEvent(boolean cancelled, boolean processed, boolean sentByThisServer, String server, ModuleName name, FEntity sender, UUID uuid, byte[] payload) Creates an instance of aProxyMessageEventrecord class.- Parameters:
cancelled- the value for thecancelledrecord componentprocessed- the value for theprocessedrecord componentsentByThisServer- the value for thesentByThisServerrecord componentserver- the value for theserverrecord componentname- the value for thenamerecord componentsender- the value for thesenderrecord componentuuid- the value for theuuidrecord componentpayload- the value for thepayloadrecord component
-
-
Method Details
-
openPayload
Opens the extra data for reading, in the same order the sender wrote it.- Returns:
- a reader over the payload
-
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).
-
withProcessed
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withSentByThisServer
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withServer
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withName
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withSender
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withUuid
- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withPayload
- 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
-
processed
-
sentByThisServer
public boolean sentByThisServer()Returns the value of thesentByThisServerrecord component.- Returns:
- the value of the
sentByThisServerrecord component
-
server
-
name
-
sender
-
uuid
-
payload
-