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
ConstructorsConstructorDescriptionInetAddressedMessage(M message, InetSocketAddress recipient) InetAddressedMessage(M message, InetSocketAddress recipient, InetSocketAddress sender) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()<N> InetAddressedMessage<N>replace(N newContent) Returns a copy of this message withnewContentas the newDefaultAddressedEnvelope.content().retain()retain(int increment) route(InetSocketAddress newRecipient) Returns a copy of this message withnewRecipientas the newDefaultAddressedEnvelope.recipient().touch()Methods inherited from class io.netty.channel.DefaultAddressedEnvelope
content, recipient, refCnt, release, release, sender, toString
-
Constructor Details
-
InetAddressedMessage
- Throws:
NullPointerException- ifmessageorrecipientisnull
-
InetAddressedMessage
- Throws:
NullPointerException- ifmessageorrecipientandsenderarenull
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
retain
- Specified by:
retainin interfaceio.netty.channel.AddressedEnvelope<M,InetSocketAddress> - Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Overrides:
retainin classio.netty.channel.DefaultAddressedEnvelope<M,InetSocketAddress>
-
retain
- Specified by:
retainin interfaceio.netty.channel.AddressedEnvelope<M,InetSocketAddress> - Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Overrides:
retainin classio.netty.channel.DefaultAddressedEnvelope<M,InetSocketAddress>
-
touch
- Specified by:
touchin interfaceio.netty.channel.AddressedEnvelope<M,InetSocketAddress> - Specified by:
touchin interfaceio.netty.util.ReferenceCounted- Overrides:
touchin classio.netty.channel.DefaultAddressedEnvelope<M,InetSocketAddress>
-
touch
- Specified by:
touchin interfaceio.netty.channel.AddressedEnvelope<M,InetSocketAddress> - Specified by:
touchin interfaceio.netty.util.ReferenceCounted- Overrides:
touchin classio.netty.channel.DefaultAddressedEnvelope<M,InetSocketAddress>
-
route
Returns a copy of this message withnewRecipientas the newDefaultAddressedEnvelope.recipient(). -
replace
Returns a copy of this message withnewContentas the newDefaultAddressedEnvelope.content().
-