Package org.drasyl.node.event
Class MessageEvent
java.lang.Object
org.drasyl.node.event.MessageEvent
- All Implemented Interfaces:
Event
This event signals that the node has received a message addressed to it.
This is an immutable object.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
abstract Object
Returns the message's payload.abstract DrasylAddress
Returns the message's sender.int
hashCode()
static MessageEvent
of
(DrasylAddress sender, Object payload) Creates a newMessageEvent
-
Constructor Details
-
MessageEvent
public MessageEvent()
-
-
Method Details
-
getSender
Returns the message's sender.- Returns:
- the message's sender
-
getPayload
Returns the message's payload.- Returns:
- the message's payload
-
equals
-
hashCode
public int hashCode() -
of
Creates a newMessageEvent
- Parameters:
sender
- the message's senderpayload
- content of the message- Throws:
NullPointerException
- ifsender
isnull
-