Package org.drasyl.channel
Class InetAddressedMessage<M>
java.lang.Object
io.netty.channel.DefaultAddressedEnvelope<M,InetSocketAddress>
org.drasyl.channel.InetAddressedMessage<M>
- Type Parameters:
M
- the type of the wrapped message
- All Implemented Interfaces:
io.netty.channel.AddressedEnvelope<M,
,InetSocketAddress> io.netty.util.ReferenceCounted
public class InetAddressedMessage<M>
extends io.netty.channel.DefaultAddressedEnvelope<M,InetSocketAddress>
A message that wraps another message with an
InetSocketAddress
.-
Constructor Summary
ConstructorDescriptionInetAddressedMessage
(M message, InetSocketAddress recipient) InetAddressedMessage
(M message, InetSocketAddress recipient, InetSocketAddress sender) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
<N> InetAddressedMessage<N>
replace
(N newContent) Returns a copy of this message withnewContent
as the newDefaultAddressedEnvelope.content()
.retain()
retain
(int increment) route
(InetSocketAddress newRecipient) Returns a copy of this message withnewRecipient
as the newDefaultAddressedEnvelope.recipient()
.touch()
Methods inherited from class io.netty.channel.DefaultAddressedEnvelope
content, recipient, refCnt, release, release, sender, toString
-
Constructor Details
-
InetAddressedMessage
- Throws:
NullPointerException
- ifmessage
orrecipient
isnull
-
InetAddressedMessage
- Throws:
NullPointerException
- ifmessage
orrecipient
andsender
arenull
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
retain
- Specified by:
retain
in interfaceio.netty.channel.AddressedEnvelope<M,
InetSocketAddress> - Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
- Overrides:
retain
in classio.netty.channel.DefaultAddressedEnvelope<M,
InetSocketAddress>
-
retain
- Specified by:
retain
in interfaceio.netty.channel.AddressedEnvelope<M,
InetSocketAddress> - Specified by:
retain
in interfaceio.netty.util.ReferenceCounted
- Overrides:
retain
in classio.netty.channel.DefaultAddressedEnvelope<M,
InetSocketAddress>
-
touch
- Specified by:
touch
in interfaceio.netty.channel.AddressedEnvelope<M,
InetSocketAddress> - Specified by:
touch
in interfaceio.netty.util.ReferenceCounted
- Overrides:
touch
in classio.netty.channel.DefaultAddressedEnvelope<M,
InetSocketAddress>
-
touch
- Specified by:
touch
in interfaceio.netty.channel.AddressedEnvelope<M,
InetSocketAddress> - Specified by:
touch
in interfaceio.netty.util.ReferenceCounted
- Overrides:
touch
in classio.netty.channel.DefaultAddressedEnvelope<M,
InetSocketAddress>
-
route
Returns a copy of this message withnewRecipient
as the newDefaultAddressedEnvelope.recipient()
. -
replace
Returns a copy of this message withnewContent
as the newDefaultAddressedEnvelope.content()
.
-