Top Description Methods
io.rsocket

public Interface Payload

extends ReferenceCounted
Known Direct Implementers
io.rsocket.util.ByteBufPayload, io.rsocket.util.DefaultPayload, io.rsocket.util.EmptyPayload, io.rsocket.ConnectionSetupPayload
Imports
io.netty.buffer.ByteBuf, io.netty.util.ReferenceCounted, .ResourceLeakDetector, java.nio.ByteBuffer, java.nio.charset.StandardCharsets

Payload of a Frame .

Method Summary

Modifier and TypeMethod and Description
public ByteBuf

Returns:

data as a bytebuf or slice of the data
data
()

Returns the Payloads' data without slicing if possible.

public default ByteBuffer
public default String
public default ByteBuffer
public default String
public boolean

Returns:

whether payload has non-null (possibly empty) metadata
hasMetadata
()

Returns whether the payload has metadata, useful for tell if metadata is empty or not present.

public ByteBuf

Returns:

metadata as a bytebuf or slice of the metadata
metadata
()

Returns the Payloads' metadata without slicing if possible.

public Payload
retain()

Redeclares io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.
public Payload
retain(int increment)

Redeclares io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.
public ByteBuf

Returns:

payload data.
sliceData
()

Returns the Payload data.

public ByteBuf

Returns:

payload metadata.
sliceMetadata
()

Returns a slice Payload metadata.

public Payload
touch()

Redeclares io.netty.util.ReferenceCounted.touch.

Records the current access location of this object for debugging purposes.
public Payload
touch(Object hint)

Redeclares io.netty.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
Inherited from io.netty.util.ReferenceCounted:
refCntreleaserelease

Method Detail

databack to summary
public ByteBuf data()

Returns the Payloads' data without slicing if possible. This is not safe and editing this could effect the payload. It is recommended to call sliceData().

Returns:ByteBuf

data as a bytebuf or slice of the data

getDataback to summary
public default ByteBuffer getData()
getDataUtf8back to summary
public default String getDataUtf8()
getMetadataback to summary
public default ByteBuffer getMetadata()
getMetadataUtf8back to summary
public default String getMetadataUtf8()
hasMetadataback to summary
public boolean hasMetadata()

Returns whether the payload has metadata, useful for tell if metadata is empty or not present.

Returns:boolean

whether payload has non-null (possibly empty) metadata

metadataback to summary
public ByteBuf metadata()

Returns the Payloads' metadata without slicing if possible. This is not safe and editing this could effect the payload. It is recommended to call sliceMetadata().

Returns:ByteBuf

metadata as a bytebuf or slice of the metadata

retainback to summary
public Payload retain()

Redeclares io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.

Annotations
@Override
retainback to summary
public Payload retain(int increment)

Redeclares io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.

Annotations
@Override
sliceDataback to summary
public ByteBuf sliceData()

Returns the Payload data. Always non-null.

Returns:ByteBuf

payload data.

sliceMetadataback to summary
public ByteBuf sliceMetadata()

Returns a slice Payload metadata. Always non-null, check hasMetadata() to differentiate null from "".

Returns:ByteBuf

payload metadata.

touchback to summary
public Payload touch()

Redeclares io.netty.util.ReferenceCounted.touch.

Records the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector. This method is a shortcut to touch(null).

Annotations
@Override
touchback to summary
public Payload touch(Object hint)

Redeclares io.netty.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you via ResourceLeakDetector.

Annotations
@Override