Module io.netty5.transport
Package io.netty5.channel
Class DefaultBufferAddressedEnvelope<A extends SocketAddress>
- java.lang.Object
-
- io.netty5.channel.DefaultAddressedEnvelope<Buffer,A>
-
- io.netty5.channel.BufferAddressedEnvelope<A,DefaultBufferAddressedEnvelope<A>>
-
- io.netty5.channel.DefaultBufferAddressedEnvelope<A>
-
- Type Parameters:
A
- the type of the recipient and sender addresses.
- All Implemented Interfaces:
AddressedEnvelope<Buffer,A>
,Resource<DefaultBufferAddressedEnvelope<A>>
,AutoCloseable
public class DefaultBufferAddressedEnvelope<A extends SocketAddress> extends BufferAddressedEnvelope<A,DefaultBufferAddressedEnvelope<A>>
The defaultAddressedEnvelope
implementation forBuffer
messages.
-
-
Constructor Summary
Constructors Constructor Description DefaultBufferAddressedEnvelope(Buffer message, A recipient)
Creates a new instance with the specifiedmessage
andrecipient
address.DefaultBufferAddressedEnvelope(Buffer message, A recipient, A sender)
Creates a new instance with the specifiedmessage
,recipient
address, andsender
address.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultBufferAddressedEnvelope<A>
replace(Buffer content)
Create a new addressed envelope instance, that has the same recipient and sender as this one, but the given content.DefaultBufferAddressedEnvelope<A>
touch(Object hint)
Record the current access location for debugging purposes.-
Methods inherited from class io.netty5.channel.BufferAddressedEnvelope
close, isAccessible, send
-
Methods inherited from class io.netty5.channel.DefaultAddressedEnvelope
content, recipient, sender, toString
-
-
-
-
Method Detail
-
replace
public DefaultBufferAddressedEnvelope<A> replace(Buffer content)
Description copied from class:BufferAddressedEnvelope
Create a new addressed envelope instance, that has the same recipient and sender as this one, but the given content.- Specified by:
replace
in classBufferAddressedEnvelope<A extends SocketAddress,DefaultBufferAddressedEnvelope<A extends SocketAddress>>
- Parameters:
content
- The contents of the returned addressed envelope instance.- Returns:
- An addressed envelope instance that has the same recipient and sender as this one, but the given content.
-
touch
public DefaultBufferAddressedEnvelope<A> touch(Object hint)
Description copied from interface:Resource
Record the current access location for debugging purposes. This information may be included if the resource throws a life-cycle related exception, or if it leaks. If this resource has already been closed, then this method has no effect.- Parameters:
hint
- An optional hint about this access and its context. May benull
.- Returns:
- This resource instance.
-
-